github.com/wasilibs/nottinygc@v0.7.2-0.20240312114022-d59c9478ef51/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  }