[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Does lua_setuservalue reference the value?
- From: "Pierre Chapuis" <catwell@...>
- Date: Sun, 13 Dec 2015 11:56:39 +0100
> 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