lua-users home
lua-l archive

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


Hi Javier,

> that puts some attention on one part we seldom discuss: how and when
> does the Lua table implementation maintains the array part?  I seem to
> remember Roberto (or Luiz?) writing that "the array part grows and
> shrinks to keep it more than half empty", or some similar specification.

I only see (looking at 5.2 code) luaH_resizearray called when
OP_SETLIST is handled; it may mean that all other assignments will
either have to fit the allocated array or will go to the hash part.
The keys will be rehashed and possibly re-allocated to the array part
when "rehash" is done; this happens when there is no free place in the
hash for a new key.

Paul.