[ocaml-ctypes] ocaml as callback to C code with event loop

Daniel Bünzli daniel.buenzli at erratique.ch
Thu May 4 19:24:11 BST 2017


On Thursday, 4 May 2017 at 19:50, Serge Sivkov wrote:
> How can I protect struct handler and fhandler function pointer from garbage collection?

I recently struggled with this on test code aswell. One thing that seems to work quite well is to store them in a toplevel  reference. 

let fhandler = ref fhandler 

Best,

Daniel




More information about the Ctypes mailing list