[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why table does not have the __gc event?
- From: Chris Marrin <chris@...>
- Date: Tue, 17 Jan 2006 08:11:34 -0800
Lisa Parratt wrote:
CHU Run-min wrote:
Just now, I found table does't have the __gc event, only userdata has.
But I don't know why.
It's so those that don't understand the consequences of the garbage
collector don't get their fingers burnt, at the expense of usability for
those who do.
You could always patch the Lua source so __gc does get called for tables
- that's what I did.
But what resource could you possibly be getting rid of? Do you have some
lightuserdatas in the table that have some data? If so, then you should
make these full userdatas and attach __gc methods to them. I can't
imagine a case where a table needs an __gc method?
--
chris marrin ,""$, "As a general rule,don't solve puzzles
chris@marrin.com b` $ that open portals to Hell" ,,.
,.` ,b` ,` , 1$'
,|` mP ,` :$$' ,mm
,b" b" ,` ,mm m$$ ,m ,`P$$
m$` ,b` .` ,mm ,'|$P ,|"1$` ,b$P ,` :$1
b$` ,$: :,`` |$$ ,` $$` ,|` ,$$,,`"$$ .` :$|
b$| _m$`,:` :$1 ,` ,$Pm|` ` :$$,..;"' |$:
P$b, _;b$$b$1" |$$ ,` ,$$" ``' $$
```"```'" `"` `""` ""` ,P`