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?

The uservalue of a userdata is like any other reference (e.g., a table
field). So, yes and yes. (But there is nothing special goin on; both
cases are just how regular references work.)

-- Roberto