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

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

Thread Next
From:
Claes Jakobsson
Date:
May 6, 2008 15:08
Subject:
[PATCH] Add SvMORTAL to check if a SV is mortalized
Message ID:
6FF0597E-D2B3-4D71-BBB6-ED2A9064D521@surfar.nu
Hi,

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

Cheers,
Claes


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About