You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Additional information
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.
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.
Original bug ID: 4398
Reporter: aij
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2011-12-17T08:26:11Z)
Resolution: won't fix
Priority: normal
Severity: feature
Version: 3.10.0
Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues
Bug description
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.
Additional information
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.
File attachments
The text was updated successfully, but these errors were encountered: