Skip to content

spinlock/jemalloc-go

 
 

Repository files navigation

jemalloc

Build Status

How to setup & install

$ mkdir -p $GOPATH/src/github.com/spinlock
$ cd $_
$ git clone https://github.com/spinlock/jemalloc-go.git
$ cd jemalloc-go
$ make install

How to use it

package demo

// #cgo         CPPFLAGS: -I<relative-path>/jemalloc-go
// #cgo  darwin  LDFLAGS: -Wl,-undefined -Wl,dynamic_lookup
// #cgo !darwin  LDFLAGS: -Wl,-unresolved-symbols=ignore-all
// #include <jemalloc/jemalloc.h>
import "C"

import jemalloc "github.com/spinlock/jemalloc-go"

func malloc1(n int) unsafe.Pointer {
    return C.je_malloc(C.size_t(n))
}

func free1(p unsafe.Pointer) {
    C.je_free(p)
}

func malloc2(n int) unsafe.Pointer {
    return jemalloc.Malloc(n)
}

func free2(p unsafe.Pointer) {
    jemalloc.Free(p)
}

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 78.5%
  • Perl 8.8%
  • C++ 5.8%
  • M4 4.3%
  • Makefile 1.2%
  • Shell 0.9%
  • Other 0.5%