How to Use go

noescape and go:nosplit Directives

Use //go:noescape to optimize pointer handling and //go:nosplit to prevent stack growth interruptions in critical Go functions.

Use //go:noescape to tell the compiler a pointer argument does not escape the function, and //go:nosplit to mark a function as safe from stack splitting during execution.

//go:noescape
func runtime_arena_arena_Slice(arena unsafe.Pointer, slice any, cap int)

//go:nosplit
func criticalSection() {
	// Code that must not be interrupted by stack growth
}