|View Issue Details [ Jump to Notes ] ||[ Issue History ] [ Print ] |
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004398||OCaml||CamlIDL||public||2007-09-19 18:16||2011-12-17 09:26|
|Assigned To||xleroy|| |
|Status||closed||Resolution||won't fix|| |
|Product Version||3.10.0|| |
|Target Version||Fixed in Version|| |
|Summary||0004398: camlidl doesn't support managed strings [PATCH]|
|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.
|Tags||No tags attached.|
|Attached Files|| camlidl-1.05-aij-managed-arrays.patch [^] (2,517 bytes) 2007-09-19 18:16 [Show Content]