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

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

Thread Next
From:
webmasters
Date:
July 25, 2010 13:11
Subject:
Re: [perl #75176] Symbol::delete_package does not free certain memory associated with package::ISA
Message ID:
00C3A546-ACB4-4E56-99E9-5CEB7391B366@ctosonline.org
This was caused by change 31239/70cd14 which fixes *ISA=[] to call mro_isa_changed_in.

The actual underlying cause is explained in mro’s manpage, under mro::get_isarev:

      Currently, this list only grows, it never shrinks.  This was a
      performance consideration (properly tracking and deleting isarev
      entries when someone removes an entry from an @ISA is costly, and it
      doesn't happen often anyways).

If it doesn’t happen often, then the cost will not be incurred very often.

Normally, the list of parent classes is cached, so Perl_mro_isa_changed_in can be made to compare it with the new list and delete isarev entries as appropriate. This may not be very efficient, but, again, it won’t happen very often, as the existing cached list will normally be empty.

S_hfreeentries is the only other routine that clears the cache, so I can make that remove isarev entries, too.

If I write a patch for this, is there any remote possibility of its being applied, or would it be a waste of time?

Another possibility for fixing this particular case is to add a function to mro:: for deleting isarev entries for particular classes. Then Symbol::delete_package could be made to use that.


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