29 #if !defined(LUAI_HASHLIMIT) 30 #define LUAI_HASHLIMIT 5 38 #define MAXSTRTB cast_int(luaM_limitN(MAX_INT, TString*)) 53 unsigned int luaS_hash (
const char *str,
size_t l,
unsigned int seed,
56 for (; l >= step; l -= step)
57 h ^= ((h<<5) + (h>>2) +
cast_byte(str[l - 1]));
76 for (i = osize; i < nsize; i++)
78 for (i = 0; i < osize; i++) {
83 unsigned int h =
lmod(p->
hash, nsize);
207 for (ts = *list; ts != NULL; ts = ts->
u.
hnext) {
208 if (l == ts->
shrlen && (memcmp(str,
getstr(ts), l *
sizeof(
char)) == 0)) {
221 memcpy(
getstr(ts), str, l *
sizeof(
char));
241 memcpy(
getstr(ts), str, l *
sizeof(
char));
258 if (strcmp(str,
getstr(p[j])) == 0)
262 for (j = STRCACHE_M - 1; j > 0; j--)
281 for (i = 0; i < nuvalue; i++)
void luaS_remove(lua_State *L, TString *ts)
#define luaM_newvector(L, n, t)
static TString * createstrobj(lua_State *L, size_t l, int tag, unsigned int h)
l_noret luaM_toobig(lua_State *L)
unsigned int luaS_hashlongstr(TString *ts)
Udata * luaS_newudata(lua_State *L, size_t s, int nuvalue)
void luaS_clearcache(global_State *g)
TString * luaS_newlstr(lua_State *L, const char *str, size_t l)
void luaC_fix(lua_State *L, GCObject *o)
static TString * internshrstr(lua_State *L, const char *str, size_t l)
TString * luaS_createlngstrobj(lua_State *L, size_t l)
#define luaM_reallocvector(L, v, oldn, n, t)
#define luaS_newliteral(L, s)
#define udatamemoffset(nuv)
void luaS_resize(lua_State *L, int nsize)
TString * strcache[STRCACHE_N][STRCACHE_M]
void luaS_init(lua_State *L)
#define sizeudata(nuv, nb)
TString * luaS_new(lua_State *L, const char *str)
GCObject * luaC_newobj(lua_State *L, int tt, size_t sz)
unsigned int luaS_hash(const char *str, size_t l, unsigned int seed, size_t step)
static void growstrtab(lua_State *L, stringtable *tb)
int luaS_eqlngstr(TString *a, TString *b)
void luaC_fullgc(lua_State *L, int isemergency)
static void tablerehash(TString **vect, int osize, int nsize)