[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: gc confusion
- From: Juergen Fuhrmann <fuhrmann@...>
- Date: Wed, 19 Feb 2003 15:48:58 +0100 (MET)
> Wed, 19 Feb 2003 11:27:44 -0300
> Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>
> > When userdata is garbage collected if I call Lua from C ? I call it
> > this way: [...]
>
> When you do
>
> lua_pushusertag(L,my,my_tag);
>
> you may create a new userdata, or not, if there is one like it already.
> (This is one of the reasons we change this in Lua 5.0. In 4.0 there
> is no way to know when you actually create a new userdata.) If you
> are creating a new userdata (that i,s "my" is a new address), then
> this stack entry is its only reference. Once myPrint returns, there is
> no reference left to this new userdata, so it should be collected in
> the next GC cycle. (It may be collected even before that, if myPrint
> modifies this argument and there is a GC cycle.)
>
Ok. This means that it needs to be garbage collected if there is no
reference. I force a GC cycle just after the call, so the linux
behaviour is right.
But why on 64 bit, the behaviour is different ?
Juergen