Created
July 14, 2017 04:25
-
-
Save jemc/d40162202e65bd5ce49e0de35654639a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let alloc_fn = @{(size: USize): Pointer[U8] => | |
@pony_alloc[Pointer[U8]](@pony_ctx[Pointer[None] iso](), size) | |
} | |
let realloc_fn = @{(p: Pointer[U8], oldsz: USize, sz: USize): Pointer[U8] => | |
@pony_realloc[Pointer[U8]](@pony_ctx[Pointer[None] iso](), p, sz) | |
} | |
let free_fn = @{(p: Pointer[U8], size: USize) => | |
None // do nothing - let Pony GC take care of it | |
} | |
@__gmp_set_memory_functions[None](alloc_fn, realloc_fn, free_fn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment