lua-users home
lua-l archive

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



On 12/05/2020 01.03, Andrea wrote:
locals are pointers to the stack (just a number because the stack frame is limited)

upvalues are pointers to the stack that can later become pointers to the heap, does this mean that every upvalue is made of 2 pointers (using twice the space) or it is made of 1 pointer with a tag that is changed/update when the upvalue is moved from the stack to the heap?

If I recall correctly, that's a yes. (The upvalue either points into the stack or into itself, the extra indirection remains throughout its lifetime.) See also section 5 (pages 8ff.) of "The Implementation of Lua 5.0" at https://www.lua.org/doc/jucs05.pdf

-- nobody
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org