Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Original bug ID: 4398
The [managed] attribute currently only works on bigarrays. This is a problem, because we are using an interface that returns malloc()ed strings. As of camlidl-1.05, the wrapper it generates copies the string and drops the reference to it.
I am attaching a patch to allow freeing arrays. (Only tested with strings so far.) Basically it just adds a .is_managed field to array_attributes, and calls free() on the array after copying it in array_c_to_ml.
A proper patch would probably involve some restructuring of idltypes.mli, so that it is an attribute on pointers, and so that arrays and bigarrays have an underlying pointer.
I don't know what the managed attribute should mean on function arguments, since I couldn't find any documentation on it, so it's just not handled now.
Comment author: @xavierleroy
I'm closing this PR because CamlIDL has been dormant since 2004. It now lives (or at least sleeps) on http://forge.ocamlcore.org/projects/camlidl/ [^] . Anyone who still cares about CamlIDL after all these years is welcome to join the project on forge.ocamlcore.org and breathe some life in it.