func checkptrAlignment(p unsafe.Pointer, elem *_type, n uintptr) { … } // checkptrStraddles reports whether the first size-bytes of memory // addressed by ptr is known to straddle more than one Go allocation. func checkptrStraddles(ptr unsafe.Pointer, size uintptr) bool { … } func checkptrArithmetic(p unsafe.Pointer, originals []unsafe.Pointer) { … } // checkptrBase returns the base address for the allocation containing // the address p. // // Importantly, if p1 and p2 point into the same variable, then // checkptrBase(p1) == checkptrBase(p2). However, the converse/inverse // is not necessarily true as allocations can have trailing padding, // and multiple variables may be packed into a single allocation. // // checkptrBase should be an internal detail, // but widely used packages access it using linkname. // Notable members of the hall of shame include: // - github.com/bytedance/sonic // // Do not remove or change the type signature. // See go.dev/issue/67401. // //go:linkname checkptrBase func checkptrBase(p unsafe.Pointer) uintptr { … }