lua-users home
lua-l archive

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


> You are quite correct about numeric keys, and it may be an issue in some
> applications. However, not freeing memory instantly is not necessarily a
> problem, and the memory will get recycled when the table grows. In fact,
> in your example, I think it will happen right away because the key 1
> would fill the table up, and hash tables are required to always have one
> free slot.

I don't think hash tables are required to have a free slot. The free slot
is looked for when a new key is being inserted, and if there isn't one,
the table is grown. If there is one, it is simply filled, so the table can
get full.

-- 
http://www.mupsych.org/~rrt/
motive, n.  a mental wolf in moral wool (Bierce)