in reply to Anonymous Data Structures: How Do They Work?
Perl stores its data structures in reference-counted chunks of memory. When the reference count falls to zero, the memory becomes available for reuse.
You can think of a structure's name (if any) as a reference with special semantics. The name lives in a symbol table or in the lexical scratchpad. When a name goes out of scope, the reference count is adjusted just as if an ordinary reference had been destroyed.
I've intentionally shifted the point of view here, presenting anonymous structures as the "normal" case and names as special. I think that attitude gives a more orthogonal factoring of storage and access.
After Compline,
Zaxo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Anonymous Data Structures: How Do They Work?
by orkysoft (Friar) on Jan 14, 2002 at 01:12 UTC |