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

Re: [perl #75176] Symbol::delete_package does not free certain memory associated with package::ISA

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
August 8, 2010 12:22
Subject:
Re: [perl #75176] Symbol::delete_package does not free certain memory associated with package::ISA
Message ID:
E557EC56-20B3-4DC1-BE1B-ED066D5DCC67@cpan.org

On Aug 2, 2010, at 2:34 AM, Nicholas Clark wrote:

> That's why there's all the "extra" code to allow hashes to store backreferences
> in the hv_aux structure. I believe that that's the logical place to hang any
> extra data needed for this.

If you are suggesting adding new fields to the xpvhv_aux struct, what do I need to know about alignment issues?

(After doing some research, it now looks as though I just need one more field; viz., a HEK* to store an alternate name.)

> Also, if it's easier to implement, I don't see a problem with using the global
> sub generation counter to flag when someone has directly manipulated the tree
> of stashes.

Doesn’t that just affect method caches? What about isa caches?

Looking through the isa code, I haven’t yet seen anything that checks PL_sub_generation, but I may have missed it.

If PL_sub_generation does not invalidate isa caches, would it be appropriate to add a new PL_isa_generation variable?

> It's not common, and I don't see an absolute need to calculate the
> strict set of packages affected, and call mro_changed_in() for just them.

And I now realise that such would be very inefficient anyway, as nested classes have nothing to do with inheritance. (*p:: = *PPI:: would have to iterate through 94 packages, recalculating the linear isa cache, etc. *p:: = delete $::{"PPI"} would do that iteration twice.)


Father Chrysostomos



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