lua-users home
lua-l archive

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



On Sep 21, 2013 2:19 PM, "Jayanth Acharya" <jayachar88@gmail.com> wrote:
>
> Does Lua not use a stack, to allocate space for "local" objects (tables, numbers, functions) ? Or is the stack used only for the variable (refering to the object, which is allocated on the GC-managed heap ? So going out of scope, pops out the variable referring to the object on heap, and if object has no other reference, then it is queued for GC. Is that the right understanding ?

How could you tell the difference? Like, is there a program or pair of programs which would behave differently depending on the answer to this question?

(From the perspective of a language definition, some of these issues can be surprisingly thorny. Particular implementations have discoverable behavior, and some of those behaviors can become de facto parts of the language. Lua has had some surprising answers to edge cases before, notably metatable reachability and the circumstances in which a table's storage may shrink.)