[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Garbage Collection
- From: "Denis Lamarche" <brainwav@...>
- Date: Mon, 27 Aug 2001 06:13:07 +0000
What if I did this:
and then run millions of things for about 24 hours. If I dont touch the
'red_door' var, will it be gc'ed after that long period of time?
From: Edgar Toernig <email@example.com>
To: Multiple recipients of list <firstname.lastname@example.org>
Subject: Re: Garbage Collection
Date: Mon, 27 Aug 2001 04:26:12 +0200
Denis Lamarche wrote:
> Does Lua garbage collect its own variable or those on the stack or both?
> If I set the gc tag of a lua variable to nil, will it still be collected
> the gc?
Hmm... you can't set tags on variables. Only on tables and userdata
So I guess you mean that. Yes, they will be collected. The gc tag allows
you to set callback functions for userdata objects. It's just a function
that gets called just before the object is freed. And the object will be
freed when it's no longer used, whether you set a gc-function or not ;-)
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp