Skip to content

Instantly share code, notes, and snippets.

@msantos
Created January 2, 2011 20:42
Show Gist options
  • Save msantos/762796 to your computer and use it in GitHub Desktop.
Save msantos/762796 to your computer and use it in GitHub Desktop.
malloc/free example NIF
-module(mem).
-export([
alloc/1,
free/1
]).
-on_load(on_load/0).
on_load() ->
erlang:load_nif("./mem", []).
alloc(_) ->
erlang:error(not_implemented).
free(_) ->
erlang:error(not_implemented).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment