diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-05-10 13:33:20 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-05-10 13:33:20 -0300 |
commit | 330e51bed3159aa83dcc9cc559c22e7d84d37604 (patch) | |
tree | 8d11540f124fe432e12296c85091947161fb3886 /lstring.h | |
parent | 44b71ca81696dbec561c0172d1b81533f1c2153e (diff) | |
download | lua-330e51bed3159aa83dcc9cc559c22e7d84d37604.tar.gz lua-330e51bed3159aa83dcc9cc559c22e7d84d37604.tar.bz2 lua-330e51bed3159aa83dcc9cc559c22e7d84d37604.zip |
string hash uses one single hash table
Diffstat (limited to 'lstring.h')
-rw-r--r-- | lstring.h | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.h,v 1.18 2000/03/10 18:37:44 roberto Exp roberto $ | 2 | ** $Id: lstring.h,v 1.19 2000/05/08 19:32:53 roberto Exp roberto $ |
3 | ** String table (keep all strings handled by Lua) | 3 | ** String table (keep all strings handled by Lua) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -12,11 +12,6 @@ | |||
12 | #include "lstate.h" | 12 | #include "lstate.h" |
13 | 13 | ||
14 | 14 | ||
15 | #define NUM_HASHSTR 32 | ||
16 | #define NUM_HASHUDATA 31 | ||
17 | #define NUM_HASHS (NUM_HASHSTR+NUM_HASHUDATA) | ||
18 | |||
19 | |||
20 | /* | 15 | /* |
21 | ** any TString with mark>=FIXMARK is never collected. | 16 | ** any TString with mark>=FIXMARK is never collected. |
22 | ** Marks>=RESERVEDMARK are used to identify reserved words. | 17 | ** Marks>=RESERVEDMARK are used to identify reserved words. |
@@ -25,11 +20,14 @@ | |||
25 | #define RESERVEDMARK 3 | 20 | #define RESERVEDMARK 3 |
26 | 21 | ||
27 | 22 | ||
23 | #define gcsizestring(L, l) numblocks(L, 0, sizeof(TString)+l) | ||
24 | #define gcsizeudata gcsizestring(L, 0) | ||
25 | |||
26 | |||
28 | void luaS_init (lua_State *L); | 27 | void luaS_init (lua_State *L); |
29 | void luaS_resize (lua_State *L, stringtable *tb, int newsize); | 28 | void luaS_resize (lua_State *L, stringtable *tb, int newsize); |
30 | TString *luaS_createudata (lua_State *L, void *udata, int tag); | 29 | TString *luaS_createudata (lua_State *L, void *udata, int tag); |
31 | void luaS_freeall (lua_State *L); | 30 | void luaS_freeall (lua_State *L); |
32 | void luaS_free (lua_State *L, TString *ts); | ||
33 | TString *luaS_newlstr (lua_State *L, const char *str, long l); | 31 | TString *luaS_newlstr (lua_State *L, const char *str, long l); |
34 | TString *luaS_new (lua_State *L, const char *str); | 32 | TString *luaS_new (lua_State *L, const char *str); |
35 | TString *luaS_newfixed (lua_State *L, const char *str); | 33 | TString *luaS_newfixed (lua_State *L, const char *str); |