|
> I think I read somewhere recently (here? the wiki?) that it will resize the array section not after you nil-out trailing entries, but when you next assign a non-nil value to an array index; it will grow or shrink it as appropriate
As far as I understand, the table is rehashed when there is no space
in the hash part of the table to insert a new key. The logic is in
luaH_newkey (ltable.c) and rehash is called when "main position is
taken?" and "cannot find a free place?" are both true.