[ocaml-ctypes] Defines, and Structs with platform-specific fields

Daniel Bünzli daniel.buenzli at erratique.ch
Sat Oct 18 10:34:17 BST 2014

Le vendredi, 17 octobre 2014 à 19:53, Trevor Smith a écrit :

> Thank you for your reply Daniel.
> About the structs: perhaps I have a fundamental misconception about how ctypes works. Libuv functions expect that the caller allocate the memory for the struct. My understanding was that adding fields to the struct in ctypes would affect the memory that struct takes up.
That's correct if you allocate it with ctypes, but you don't need to. Just make a C function that allocates the struct and bind to that function.  


More information about the Ctypes mailing list