lua-users home
lua-l archive

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


Thinking about upvalues makes me wonder: is there any generic way to learn the size in bytes of a table in Lua?  Since a table can have other tables or functions (or at least references to them) in it this is not a simple concept.  Perhaps another way to ask this is: can I predict from within a program how much memory would be released if I cause a given object to go out of scope?


Jose Torre-Bueno
jtorrebueno@cox.net




On Mar 31, 2012, at 7:54 PM, Luiz Henrique de Figueiredo wrote:

>> I'm personally not a fan of referring to _G as a specific object, but yes.
> 
> Especially because _G is not a core Lua concept whereas _ENV is,
> even if it's in a single spot in the parser.
>