On 19.08.2013 06:13, Mikael wrote:Could be, but i think this is not the case. The documentation mentioned
> std::string requires delete to be used for proper deallocation and
> free() might just partially deallocate it, no? - what about trying with
> some more ordinary struct like tm ?
if gambit is using g++ it should actually use 'delete (type*)
internal-pointer'.
I've also checked this with a POD struct:
struct test { int A; int B }
It's no difference if
* struct test is allocated with new
* struct test is allocated with malloc
It's also leaking memory.
When the release-function is not specified or is #f
a default function is constructed by the C-interface.
This default function does nothing in the case of thepointer
andnonnull-pointer
types (deallocation is not the responsibility of the C-interface) and returns the fixnum ‘___FIX(___NO_ERR)’ to indicate no error.
In the case of thestruct
,union
andtype
types, the default function reclaims the copy on the C heap referenced by the internal pointer (when using a C++ compiler this is done using ‘delete (type*)internal-pointer’, which calls the destructor of type if it is a class) and returns ‘___FIX(___NO_ERR)’.
_______________________________________________
Gambit-list mailing list
Gambit-list@iro.umontreal.ca
https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list