develooper Front page | perl.perl5.porters | Postings from August 2013

[perl #108280] @ISA self-loop

From:
Father Chrysostomos via RT
Date:
August 3, 2013 01:03
Subject:
[perl #108280] @ISA self-loop
Message ID:
rt-3.6.HEAD-2552-1375491825-965.108280-14-0@perl.org
On Sun Jan 15 12:43:57 2012, sprout wrote:
> $ ./perl -Ilib -le '@ISA = "foo"; use Scalar::Util weaken;
> weaken($a=\@ISA); undef *ISA; print $a'
> ARRAY(0x826ba0)
> 
> @ISA has its own loop that prevents it from being freed.
> 
> It seems we need a way for the backreferences array to point to magic,
> not just SVs.

No, what we need is for the elements’ magic to have no reference count
on the array and for the array to have free magic that clears the magic
of its elements (for efficiency only if their refcount > 1).

-- 

Father Chrysostomos




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