aboutsummaryrefslogtreecommitdiff
path: root/lstring.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-04-01 10:52:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-04-01 10:52:41 -0300
commit7288528a1e081d101a1bc19346a974088b6b8315 (patch)
tree8a3b73aafaea2d705ea1f53e131d38f29aef52fd /lstring.h
parent513559cc4760392b6fa33754c516683ef49dba22 (diff)
downloadlua-7288528a1e081d101a1bc19346a974088b6b8315.tar.gz
lua-7288528a1e081d101a1bc19346a974088b6b8315.tar.bz2
lua-7288528a1e081d101a1bc19346a974088b6b8315.zip
Short strings always use all bytes in the hash
Collisions in short strings occurr just by their existence, when internalizing them. (Collisions in long strings is caused/controlled by the program, when adding them as keys to the same table.)
Diffstat (limited to 'lstring.h')
-rw-r--r--lstring.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lstring.h b/lstring.h
index c23d6874..56896867 100644
--- a/lstring.h
+++ b/lstring.h
@@ -37,7 +37,8 @@
37#define eqshrstr(a,b) check_exp((a)->tt == LUA_VSHRSTR, (a) == (b)) 37#define eqshrstr(a,b) check_exp((a)->tt == LUA_VSHRSTR, (a) == (b))
38 38
39 39
40LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); 40LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l,
41 unsigned int seed, size_t step);
41LUAI_FUNC unsigned int luaS_hashlongstr (TString *ts); 42LUAI_FUNC unsigned int luaS_hashlongstr (TString *ts);
42LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); 43LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b);
43LUAI_FUNC void luaS_resize (lua_State *L, int newsize); 44LUAI_FUNC void luaS_resize (lua_State *L, int newsize);