github.com/pidato/unsafe@v0.1.4/memory/rpmalloc/rpmalloc.go (about)

     1  //go:build !tinygo
     2  // +build !tinygo
     3  
     4  package rpmalloc
     5  
     6  /*
     7  //#cgo darwin,amd64 LDFLAGS: -Wl,-rpath,${SRCDIR}/lib/darwin_amd64 -L${SRCDIR}/lib/darwin_amd64
     8  //#cgo darwin,amd64 LDFLAGS: -lrpmalloc -ldl -lc -lm
     9  //#cgo darwin,arm64 LDFLAGS: -Wl,-rpath,${SRCDIR}/lib/darwin_arm64 -L${SRCDIR}/lib/darwin_arm64
    10  //#cgo darwin,arm64 LDFLAGS: -lrpmalloc -ldl -lc -lm
    11  //#cgo linux,amd64 LDFLAGS: -Wl,-rpath,${SRCDIR}/lib/linux_amd64 -L${SRCDIR}/lib/linux_amd64
    12  //#cgo linux,amd64 LDFLAGS: -lrpmalloc -ldl -lc -lm
    13  //#cgo linux,amd64 CFLAGS: -D_GNU_SOURCE
    14  #include "rpmalloc.h"
    15  */
    16  import "C"
    17  
    18  func init() {
    19  	C.rpmalloc_initialize()
    20  }
    21  func Init() {}
    22  
    23  type Heap C.rpmalloc_heap_t