lua-users home
lua-l archive

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


On Mon, Apr 6, 2009 at 11:41 PM, Fabien <fleutot+lua@gmail.com> wrote:
> There could be many definitions of "large tables", so you have to pick one,
> and implement the corresponding algorithm. For instance, what's the size of
> table { _G, _G } ?
>

Obviously the size of the allocated table's header (no idea how Lua
represents this internally, so sorry if I'm mis-using terms) plus the
length of 2 references to another table (I presume all such references
are of a fixed size).

> As for strings, they're stored in a global table, accessible in one of lua
> state's fields, called "strt" IIRC; you can easily write a C function to
> traverse it.
>

I would be extremely happy to see at least a function to get the
actual size in *bytes* of a given object in 5.2. Perhaps in the debug
library.

Is such a function possible?

Matthew.