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)

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 ?

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.

Graham.

Reply via email to