[ocaml-ctypes] GC finalizer

Jacques-Pascal Deplaix jp.deplaix at gmail.com
Mon Feb 2 20:16:52 GMT 2015


Hi again,

I'm wondering how the values (pointers allocated on the heap) created by 
a C function, binded through ctypes should be freed. Is there a standard 
way to do that ?

In my example, the memphis library allocate some memory in 
Memphis_renderer.create and should be freed via Memphis_renderer.destroy 
but is there a way to call memphis_renderer_destroy automatically using 
the OCaml GC ?

Cheers,


More information about the Ctypes mailing list