lua-users home
lua-l archive

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


Thanks, but I'm not sure I understand your answer. When the table is rehashed all new nodes are set as free because lastfree points to to the last node, and then the existing elements are added to the new hash part.

My question is, if a node is freed but its address is greater than lastfree does it remain free until the table is either rehashed or collected?

Cheers,

Andre

On 25/10/2010 21:00, Marc OMorain wrote:
It is possible to cause a re-hash operation with the steps that you have described. The re-hash algorithm will calculate a new size for the table. When selecting a new size, the free nodes in the table will be noticed, and taken into account.


On 25 October 2010 18:29, Andre Leiradella <andre@leiradella.com> wrote:
Hi All,

I was taking a look at the hash's part of the Lua's table implementation but am unsure about the logic behind the free list. Is it true that nodes that are freed and have their addresses greater than lastfree are not re-utilized so the table can grow when there are still free elements in it?

Thanks,

Andre