develooper Front page | perl.perl5.porters | Postings from February 2003

Re: New SV Flag

Thread Previous | Thread Next
From:
Tim Bunce
Date:
February 10, 2003 04:30
Subject:
Re: New SV Flag
Message ID:
20030210122744.GB33029@dansat.data-plan.com
On Sat, Feb 08, 2003 at 06:59:42PM +0000, Nicholas Clark wrote:
> On Thu, Feb 06, 2003 at 12:15:31PM +0000, Tim Bunce wrote:
> 
> > sv_free does:
> > 
> >     ATOMIC_DEC_AND_TEST(refcount_is_zero, SvREFCNT(sv));
> >     if (!refcount_is_zero)
> >         return;
> >     sv_clear(sv);
> >     if (! SvREFCNT(sv))
> >         del_SV(sv);
> > 
> > I can't remember why the last SvREFCNT(sv) test is there
> > but perhaps it could be useful for you... sv_clear calls
> > mg_free, your magic destructor could test for SvREFCNT(sv)==0
> > to know that the sv was about to be freed and set SvREFCNT
> > to a non-zero value to prevent the final del_SV.
> 
> I find that I can take that check out without failing any regression tests.
> This is somewhat bad - what is it in there for?
> 
> I have this feeling that Richard Clamp has some idea of what's going on here,
> as I seem to remember him mailing a list (forget which) some games with what
> happens on various perl versions if an object attempts to stop itself being
> destroyed.
> 
> But even that doesn't explain its intended purpose.

Isn't there a code repositiory browser tool thingy that'll show the
last change which affected any given line? (If not there ought to be.)

Tim.

Thread Previous | 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