lua-users home
lua-l archive

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


Op zaterdag 25 juli 2020 08:29:47 CEST schreef Philippe Verdy:
> and all the rest is populated by
> assignments, the array part is not evolving, there's no strategy to move
> items from the hash part to the array part.

A while back I did some investigation about forcing the size for the array part and the hash part of a table.
In Lua 5.3.5, when the table grows, it may trigger a rehash.
When rehashing, an integer key may be moved to the array part if the sequence is contiguous.
This happens in ltable.c in the functions 'luaH_newkey', 'rehash', 'luaH_resize' and 'reinsert'.

-- Jasper