lua-users home
lua-l archive

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

On Thu, Jan 19, 2012 at 18:02, Roberto Ierusalimschy <> wrote:
> Actually the right thing to do is have a 0 hash value for these strings and
> then when the string is actually used in a table by a Lua programmer hash
> the entire string to get its value.  That way the security of the system is
> protected (because a randomized hash of the full string is used), but the
> performance is still good as the hashing is delayed until needed.

This is more in line with what we are considering. Also remember that we
can use the variant bits to differentiate short strings from long strings.
So, short strings can be compared with pointer equality and long strings
with memcmp; short strings are never compared with long strings (as
their tags are already different).

OK.  Cool.  This is a showstopper for the company I am working with for rolling out embedded Lua with nginx.  Is there anything I can do to help?