[gambit-list] Proper usage of ffi structs
ruunsmail at gmail.com
Thu Aug 22 18:08:19 EDT 2013
On 22.08.2013 16:53, Marc Feeley wrote:
> Deallocation of the structures is done correctly and there is no memory leak or segmentation faults. If the return type had been a C++ class, the destructor would have been called just prior to its deallocation by the GC, as expected.
> There seems to be a problem however in the "inline" c-lambda form (as used in the definition of make-point2). The definition should be equivalent to the definition of make-point, but isn't. That's a bug that I will investigate.
> I suggest that for the time being, you avoid using inline c-lambda forms that return structures. This means you will have to create a C function that returns a structure, and use the plain c-lambda form to interface to that C function.
Okay, that makes definitely sense :-D
thanks for your clarification, Marc.
More information about the Gambit-list