in reply to Re: Perl with Swig C module not releasing memory
in thread [Solved] Perl with Swig C module not releasing memory

Sorry. Figured it could be generated from that. I'd post it but it's some 1938 lines of code.

...but didn't think to look at that I'll poke around see if I can find out if perl is overwriting the malloc/free functions. Also what's 'WAG'?

  • Comment on Re^2: Perl with Swig C module not releasing memory

Replies are listed 'Best First'.
Re^3: Perl with Swig C module not releasing memory
by bulk88 (Priest) on May 10, 2013 at 21:47 UTC
    http://en.wikipedia.org/wiki/Wag_%28disambiguation%29

    WAG, an acronym for "wild ass guess", an estimate based on experience or similarity

    Use readmore tags to post long code, dont force the moderators to do it for you. To find out if perl redefined your malloc/free functions, make a .i file from the SWIG outputted .c file. It will be half a MB so don't post the whole thing here, just an function or 2. Your Malloc macro will be expanded to the actual C func symbol that will be called, which might be a perl allocator, not your C compiler's malloc.

      You are correct XSUB.h in the CORE files is what's redefining free() to PerlMem_free and the memory isn't getting released.

      Still trying to figure out how to keep that from happening.