[Clp] C interface asks user to call delete[]

Miles Lubin miles.lubin at gmail.com
Tue Dec 18 01:14:29 EST 2012


Hi all,

Some of you may be interested to know that Carlo Baldassi and I are working
on a Clp interface for the new language Julia (http://julialang.org/).
Julia is currently capable of calling only C-based APIs, so we are using
Clp_C_Interface.h, which has been working well so far. One small snag is
with Clp_infeasibilityRay and Clp_unboundedRay, which return pointers which
the user is expected to free by calling delete[]. We don't have the ability
to do this from Julia. While there are hackish workarounds, this really
seems like an issue with the interface, since a user in C shouldn't be
expected to call C++'s delete.

Looking at Clp_C_Interface.cpp and ClpModel.cpp, it looks like a quick fix
to move some logic into Clp_C_Interface.cpp so that the arrays can be
allocated with malloc(). I'm happy to make a patch if that would be the
easiest course of action.

Thanks,
Miles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20121218/6a03434e/attachment.html>


More information about the Clp mailing list