in reply to perl_destruct clearing memory allocated in c library

Do you call malloc or free in a file that does #include perl.h? Perl redefines them.

Do you set the PV of a SV to the buffer? Then set the LEN to 0 to prevent Perl from freeing it.

  • Comment on Re: perl_destruct clearing memory allocated in c library

Replies are listed 'Best First'.
Re^2: perl_destruct clearing memory allocated in c library
by justin_skariah (Initiate) on Mar 24, 2011 at 13:34 UTC

    Actually the symbol buffer.17598 which valgrind says is causing the problem is been found in one 'so' file I use. I greped all the so files. And I doubt that 'so' file is using perl.h. I don't have source code for that 'so'.

    Sorry but I couldn't understand what PV and SV means.

      I was asking if you were passing it to Perl. But I guess you already answered that ("but no reference is passed in or out of c.").