github.com/go-eden/common@v0.1.15-0.20210617133546-059099253264/emem/mem_asm.go (about) 1 package emem 2 3 import ( 4 "unsafe" 5 ) 6 7 //go:linkname memclr runtime.memclrNoHeapPointers 8 func memclr(ptr unsafe.Pointer, n uintptr) 9 10 //go:linkname roundupsize runtime.roundupsize 11 func roundupsize(size uintptr) uintptr 12 13 // Clear clear the specified memory, which is [ptr, ptr+n) 14 func Clear(ptr unsafe.Pointer, n uintptr) { 15 memclr(ptr, n) 16 }