develooper Front page | perl.perl5.porters | Postings from November 1999

Re: Behaviour of final cleanup

Thread Previous
From:
Ian Phillipps
Date:
November 23, 1999 15:29
Subject:
Re: Behaviour of final cleanup
Message ID:
19991121222934.C17718@homer.diplex.co.uk
On Wed, 17 Nov 1999 at 10:03:19 -0800, Gurusamy Sarathy wrote:
> On Wed, 17 Nov 1999 17:48:01 +0100, Raphael Manfredi wrote:
> ># I don't understand the way Perl garbage collects its memory when it dies.
> ># It does not systematically call registered destructors (DESTROY) on objects.
> This would be a bug.  If you have a short test case, that would be good
> to see.

Note that Perl doesn't do any sort of cleanup if you call exec().  This is
right (consider the use of fork+exec), but you need to be aware of it,
especially if tainted evals are available to the user.
I confess to having thought about using this to speed up a program (that
spent 50% of its run time in removing blessed objects with no
destructors).

Presumably it doesn't clean up on fatal memory exhaustion, either.

Ian

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About