lua-users home
lua-l archive

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


> When I set a function argument as the uservalue of a userdata object, is
> that value automatically being referenced (like luaL_ref()) and will thus
> not be auto-gc'ed?
>
> And if so, when the userdata is later being gc'ed, will the refercen to
> the uservalue be un-refed?

If I understand well the question, there is no need for such
a mechanism because the GC knows about uservalues and takes
them into account in the mark phase. [1]

[1] http://www.lua.org/source/5.3/lgc.c.html#reallymarkobject

-- 
Pierre Chapuis