develooper Front page | perl.perl6.internals | Postings from September 2005

global destruction

Thread Next
Nicholas Clark
September 6, 2005 09:01
global destruction
Message ID:
For starters, in glossary.pod I'm failing to find definitions for
"destruction" and "finalisation". One is about cleanup actions on objects/
PMCs that need something actively cleaned up, rendering active objects down
to bare memory, and the other is about reclaiming bare memory for re-use.

For starters, I'm interested in the first one - rendering down active objects
to bare memory, whatever it's called. I'm also not directly interested in
"high priority DOD" for "timely destruction" of hot objects. What I want to
know is

  does parrot make any guarantee that all objects will be rendered down to
  bare memory before program exit?

At interpreter exit perl 5 scans all the active allocated scalars to find
objects, and causes all references to them to be undefined, which will cause
DESTROY to be called on all of them. This will even catch objects trapped in
reference counting loops.

Second question is that optionally perl 5 can run with complete global
destruction. This is primarily intended for embedded interpreters, where
the default implementation (just exit the process to free all memory) is
clearly not an option. Does parrot have any sort of built in ability to
change mode to force all memory ever allocated to be freed up?

At the moment ponie is tracking all PMCs it allocates so that it can emulate
both the object destruction, and the full destruction. I'm wondering if there
is parrot infrastructure I can use to avoid needing to do this.

Nicholas Clark

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About