Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camlidl doesn't support managed strings [PATCH] #4398

Closed
vicuna opened this issue Sep 19, 2007 · 1 comment
Assignees

Comments

@vicuna
Copy link

@vicuna vicuna commented Sep 19, 2007

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

@vicuna

This comment has been minimized.

Copy link
Author

@vicuna vicuna commented Dec 17, 2011

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.