On Wed, 23 Feb 2005, William Ahern wrote:

> Has anyone run into the issue of av_undef not doing what is advertized in
> perlguts, namely freeing the object? I realize the solution is just to
> decrement the ref count like anything else, but in uncovering my memory leak
> I found a lot of other people were bit by this. Has the man page ever been
> updated?

I have spent an enormous amount of time chasing memory leaks in my XS 
code, but I'm not sure it's the same mechanism.  One application in 
particular parses a text file using flex/bison and sequentially builds 
complex perl data structures to pass into registered perl callbacks.

For reasons I've never been able to figure out, this memory never gets 
freed; even though no references are taken on the perl side and all 
structures are recursively undefined in C.

Documentation claims that the storage is freed when flow of control 
"leaves the current context", but I wonder what that means in concrete 
terms.  Does a return from an XS call count as "leaving the context"?

This one does hit close to home..

Steve

Reply via email to