----- Original Message -----
From: "Michael G Schwern" <[EMAIL PROTECTED]>
To: "K Stol" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, August 18, 2003 2:49 AM
Subject: Re: What the heck is: timely destruction


> On Mon, Aug 18, 2003 at 11:38:22AM -0700, K Stol wrote:
> > if I understood correctly, the problem is that some objects should be
> > destroyed *immediately*, and should not wait for the GC.
>
> Yep.  In perl 5 *all* objects and variables are to be destroyed
immediately.
> This doesn't necessarily mean that their memory has to be freed but that
> at least their destructor methods are called.
>
>
> > In fact, the programmer may have never heard about a garbage collecting
> > system at all, and just *assume* that everything which is out of scope,
> > is destroyed.
>
> Yep.  That's how most languages with lexical variables work these days.
>
>
> > In real life, these objects may live somewhere in memory, waiting for
the GC,
> > but in fact are still there, so checking them for being alive will not
yield
> > the correct result.
>
> I don't understand what you're saying there.

Uhm, I didn't realize destructor methods were called, but now I see that's
the whole point:
destructor methods should be called when doing timely destruction.
You already said just now:

> This doesn't necessarily mean that their memory has to be freed but that
> at least their destructor methods are called.

So the objects may be still in memory. I thought the fact that they are
still in memory
was troublesome, but it's not, if I interpret your statement well.

Klaas-Jan


Reply via email to