github.com/primecitizens/pcz/std@v0.2.1/core/mark/internal/reflect/doc.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  package reflect
     5  
     6  import (
     7  	"unsafe"
     8  	_ "unsafe" // for go:linkname
     9  )
    10  
    11  // the noescape function MUST be in the reflect package to get inlined.
    12  //
    13  // See ${GOROOT}/src/cmd/compile/internal/inline/inl.go#func:(*hairyVisitor).doNode
    14  //
    15  //pcz:importpath reflect
    16  
    17  //go:linkname noescape
    18  func noescape(p unsafe.Pointer) unsafe.Pointer {
    19  	x := uintptr(p) // this line is required
    20  	return unsafe.Pointer(x ^ 0)
    21  }