lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>does lua_newuserdata() still not create any references to the allocated
>memory? for example, if the userdata remains on the stack, but does not get
>assigned to a table does it get collected before it gets removed from the
>stack?

No. Objects in the stack do not get collected.

>also, how does gc work for userdata created with this function. is a gc
>event generated for each reference collected, or when all references to the
>allocated memory are no longer in the state or on the stack?

GC tag methods are called for each object being freed, not for each reference
to them.
--lhf