Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for shrinkstack (0.18 sec)

  1. src/runtime/testdata/testprog/checkptr.go

    }
    
    // CheckPtrAlignmentNilPtr tests that checkptrAlignment doesn't crash
    // on nil pointers (#47430).
    func CheckPtrAlignmentNilPtr() {
    	var do func(int)
    	do = func(n int) {
    		// Inflate the stack so runtime.shrinkstack gets called during GC
    		if n > 0 {
    			do(n - 1)
    		}
    
    		var p unsafe.Pointer
    		_ = (*int)(p)
    	}
    
    	go func() {
    		for {
    			runtime.GC()
    		}
    	}()
    
    	go func() {
    		for i := 0; ; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 31 17:15:15 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  2. src/runtime/stack.go

    }
    
    // Maybe shrink the stack being used by gp.
    //
    // gp must be stopped and we must own its stack. It may be in
    // _Grunning, but only if this is our own user G.
    func shrinkstack(gp *g) {
    	if gp.stack.lo == 0 {
    		throw("missing stack in shrinkstack")
    	}
    	if s := readgstatus(gp); s&_Gscan == 0 {
    		// We don't own the stack via _Gscan. We could still
    		// own it if this is our own user G and we're on the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:31:00 UTC 2024
    - 41.1K bytes
    - Viewed (0)
  3. src/runtime/export_test.go

    func ShrinkStackAndVerifyFramePointers() {
    	before := stackPoisonCopy
    	defer func() { stackPoisonCopy = before }()
    	stackPoisonCopy = 1
    
    	gp := getg()
    	systemstack(func() {
    		shrinkstack(gp)
    	})
    	// If our new stack contains frame pointers into the old stack, this will
    	// crash because the old stack has been poisoned.
    	FPCallers(make([]uintptr, 1024))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:50:53 UTC 2024
    - 46.1K bytes
    - Viewed (0)
  4. src/runtime/runtime2.go

    // releaseSudog to allocate and free them.
    type sudog struct {
    	// The following fields are protected by the hchan.lock of the
    	// channel this sudog is blocking on. shrinkstack depends on
    	// this for sudogs involved in channel ops.
    
    	g *g
    
    	next *sudog
    	prev *sudog
    	elem unsafe.Pointer // data element (may point to stack)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:37 UTC 2024
    - 47.9K bytes
    - Viewed (0)
  5. src/runtime/mgcmark.go

    	p := getg().m.p.ptr()
    	p.scannedStackSize += uint64(scannedSize)
    	p.scannedStacks++
    
    	if isShrinkStackSafe(gp) {
    		// Shrink the stack if not much of it is being used.
    		shrinkstack(gp)
    	} else {
    		// Otherwise, shrink the stack at the next sync safe point.
    		gp.preemptShrink = true
    	}
    
    	var state stackScanState
    	state.stack = gp.stack
    
    	if stackTraceDebug {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 21:25:11 UTC 2024
    - 52.5K bytes
    - Viewed (0)
Back to top