// NoEscape hides the pointer p from escape analysis, preventing it // from escaping to the heap. It compiles down to nothing. // // WARNING: This is very subtle to use correctly. The caller must // ensure that it's truly safe for p to not escape to the heap by // maintaining runtime pointer invariants (for example, that globals // and the heap may not generally point into a stack). // //go:nosplit //go:nocheckptr func NoEscape(p unsafe.Pointer) unsafe.Pointer { … } var alwaysFalse … var escapeSink … // Escape forces any pointers in x to escape to the heap. func Escape[T any](x T) T { … }