On Wed, Jan 09, 2002 at 04:42:51PM +0000, Graham Barr wrote: > On Tue, Jan 08, 2002 at 06:38:02PM -0500, Dan Sugalski wrote: > > ># Attributes are done as a hash of hashes. Each interpreter has a > > ># pointer to an attribute hash, whose keys are the attribute names. The > > ># values will be hash pointers. Those hashes will each have a key which > > ># is a PMC pointer (hashed up somehow) and the value is the attribute > > ># value. > > > > > >If you're talking about 'is'-style attributes, why not have them be > > >attached to the PMCs themselves? > > > > D'you want an attribute pointer for each PMC? (I've considered it, but for > > the moment I think it'll be too expensive. Might be wrong)
This sounds rather like perl5's optional list of arbitrary 'magic'. Can't PMC's be 'upgraded' so only carry the overhead if needed? > On the other hand when a variable is garbage collected you have to walk the hash > of hashes to clear out the attributes. Also what happens when you move the PMC > during garbage collection, will the key in the hash change ? Good points. > A PMC may have a flag to show if it has any entries in the global table, > but it is probably just a trade off between space and performance. Tim [who's not really been paying attention, so ignore me if I'm being daft].