develooper Front page | perl.perl5.porters | Postings from May 2008

[PATCH] Add SvMORTAL to check if a SV is mortalized

Thread Next
Claes Jakobsson
May 6, 2008 15:08
[PATCH] Add SvMORTAL to check if a SV is mortalized
Message ID:

while trying to find a memory leak in my JavaScript/Perl bridge I felt  
a need for checking if SVs I got back from deep within my module were  
mortal or not. Unfortunately there was no SvMORTAL so applied is a  
patch that adds it.

The SvMORTAL is a macro that checks if SVs_TEMP is on and if so calls  
the new funciton sv_in_tmps.

sv_in_tmps walks the PL_tmps_stack from PL_tmps_root to PL_tmps_ix to  
see if the SV is on the stack. Maybe traversal of the complete  
PL_tmps_stack would be a better idea.

I dunno if this could be of any use to others.

Patch is against 5.10.0


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About