github.com/higress-group/nottinygc@v0.0.0-20231101025119-e93c4c2f8520/malloc.go (about) 1 // Copyright wasilibs authors 2 // SPDX-License-Identifier: MIT 3 4 package nottinygc 5 6 /* 7 #include <stdlib.h> 8 */ 9 import "C" 10 import "unsafe" 11 12 func cmalloc(size uintptr) unsafe.Pointer { 13 return C.malloc(C.size_t(size)) 14 } 15 16 func cfree(ptr unsafe.Pointer) { 17 C.free(ptr) 18 }