Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for IsPinned (0.17 sec)

  1. src/runtime/pinner_test.go

    	o := new(obj)
    	ifc := any(o)
    	pinner.Pin(&ifc)
    	if !runtime.IsPinned(unsafe.Pointer(&ifc)) {
    		t.Fatal("not marked as pinned")
    	}
    	if runtime.IsPinned(unsafe.Pointer(o)) {
    		t.Fatal("marked as pinned")
    	}
    	pinner.Unpin()
    	pinner.Pin(ifc)
    	if !runtime.IsPinned(unsafe.Pointer(o)) {
    		t.Fatal("not marked as pinned")
    	}
    	if runtime.IsPinned(unsafe.Pointer(&ifc)) {
    		t.Fatal("marked as pinned")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 13 18:36:12 UTC 2023
    - 11K bytes
    - Viewed (0)
  2. src/runtime/pinner.go

    		panic(errorString("runtime.Pinner: object was allocated into an arena"))
    	}
    	return e.data
    }
    
    // isPinned checks if a Go pointer is pinned.
    // nosplit, because it's called from nosplit code in cgocheck.
    //
    //go:nosplit
    func isPinned(ptr unsafe.Pointer) bool {
    	span := spanOfHeap(uintptr(ptr))
    	if span == nil {
    		// this code is only called for Go pointer, so this must be a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 11K bytes
    - Viewed (0)
  3. src/runtime/cgocheck.go

    	// that look like they are non-Go memory.
    	if gp.m.mallocing != 0 {
    		return
    	}
    
    	// If the object is pinned, it's safe to store it in C memory. The GC
    	// ensures it will not be moved or freed.
    	if isPinned(src) {
    		return
    	}
    
    	// It's OK if writing to memory allocated by persistentalloc.
    	// Do this check last because it is more expensive and rarely true.
    	// If it is false the expense doesn't matter since we are crashing.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 09 04:07:57 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  4. src/runtime/cgocall.go

    		if !cgoIsGoPointer(p) {
    			return
    		}
    		if !top && !isPinned(p) {
    			panic(errorString(msg))
    		}
    		cgoCheckArg(it, p, it.Kind_&abi.KindDirectIface == 0, false, msg)
    	case abi.Slice:
    		st := (*slicetype)(unsafe.Pointer(t))
    		s := (*slice)(p)
    		p = s.array
    		if p == nil || !cgoIsGoPointer(p) {
    			return
    		}
    		if !top && !isPinned(p) {
    			panic(errorString(msg))
    		}
    		if !st.Elem.Pointers() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:47 UTC 2024
    - 24.2K bytes
    - Viewed (0)
  5. src/runtime/export_test.go

    func FPCallers(pcBuf []uintptr) int {
    	return fpTracebackPCs(unsafe.Pointer(getfp()), pcBuf)
    }
    
    const FramePointerEnabled = framepointer_enabled
    
    var (
    	IsPinned      = isPinned
    	GetPinCounter = pinnerGetPinCounter
    )
    
    func SetPinnerLeakPanic(f func()) {
    	pinnerLeakPanic = f
    }
    func GetPinnerLeakPanic() func() {
    	return pinnerLeakPanic
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:50:53 UTC 2024
    - 46.1K bytes
    - Viewed (0)
Back to top