github.com/jxskiss/gopkg/v2@v2.14.9-0.20240514120614-899f3e7952b4/internal/linkname/runtime.go (about)

     1  package linkname
     2  
     3  import "unsafe"
     4  
     5  // Pid returns the id of current p.
     6  //
     7  //go:nosplit
     8  func Pid() int {
     9  	pid := runtime_procPin()
    10  	runtime_procUnpin()
    11  	return pid
    12  }
    13  
    14  //go:linkname runtime_procPin runtime.procPin
    15  //go:nosplit
    16  func runtime_procPin() int
    17  
    18  //go:linkname runtime_procUnpin runtime.procUnpin
    19  //go:nosplit
    20  func runtime_procUnpin()
    21  
    22  // -------- runtime hash functions --------
    23  
    24  //go:linkname Runtime_memhash32 runtime.memhash32
    25  func Runtime_memhash32(p unsafe.Pointer, h uintptr) uintptr
    26  
    27  //go:linkname Runtime_memhash64 runtime.memhash64
    28  func Runtime_memhash64(p unsafe.Pointer, h uintptr) uintptr
    29  
    30  //go:linkname Runtime_stringHash runtime.stringHash
    31  func Runtime_stringHash(s string, seed uintptr) uintptr
    32  
    33  //go:linkname Runtime_bytesHash runtime.bytesHash
    34  func Runtime_bytesHash(b []byte, seed uintptr) uintptr
    35  
    36  //go:linkname Runtime_efaceHash runtime.efaceHash
    37  func Runtime_efaceHash(i any, seed uintptr) uintptr
    38  
    39  //go:linkname Runtime_typehash runtime.typehash
    40  func Runtime_typehash(rtype unsafe.Pointer, p unsafe.Pointer, h uintptr) uintptr
    41  
    42  // -------- runtime moduledata --------
    43  
    44  //go:linkname Runtime_activeModules runtime.activeModules
    45  func Runtime_activeModules() []unsafe.Pointer