lua-users home
lua-l archive

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


> the hash for objects such as tables and functions seems to be the memory
> address at which they are stored, this is indeed unique but due to
> alignment when it is reduced modulo 2^n (the size of the table) it may
> cause many collisions
> 
> does Lua do something to randomize the memory address or the hash derived
> from the memory address?

For these objects, the final hash is done modulo table size - 1, which
is a Mersene number.

-- Roberto
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org