lua-users home
lua-l archive

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


Lua 5.2+ has function debug.upvalueid(f, n) returning a light userdata.
Does Lua guarantee debug.upvalueid() returns the same result during the lifespan of the closure?

local f = function()....end
local n = ....
local old_id = debug.upvalueid(f, n)
.... GC activity may happen here
local new_id = debug.upvalueid(f, n)
print(new_id == old_id)  -- Is it always true?