Hello!

Recently I read some go source code and when I read the noescape function 
in runtime/stubs.go, I have a doubt about it.

// noescape hides a pointer from escape analysis.  noescape is
// the identity function but escape analysis doesn't think the
// output depends on the input.  noescape is inlined and currently
// compiles down to zero instructions.
// USE CAREFULLY!
//go:nosplit
func noescape(p unsafe.Pointer) unsafe.Pointer {
   x := uintptr(p)
   return unsafe.Pointer(x ^ 0)
}



I don't know what's the purpose of the exclusive or operation? Does it 
necessary?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/35fdf376-75eb-4c58-898f-de3be915babe%40googlegroups.com.

Reply via email to