aboutsummaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lstring.c b/lstring.c
index ac526838..ffc834b8 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.c,v 1.38 2000/06/12 13:52:05 roberto Exp roberto $ 2** $Id: lstring.c,v 1.39 2000/06/15 17:01:12 roberto Exp roberto $
3** String table (keeps all strings handled by Lua) 3** String table (keeps all strings handled by Lua)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -28,9 +28,9 @@ void luaS_init (lua_State *L) {
28 28
29 29
30void luaS_freeall (lua_State *L) { 30void luaS_freeall (lua_State *L) {
31 LUA_ASSERT(L, L->strt.nuse==0, "non-empty string table"); 31 LUA_ASSERT(L->strt.nuse==0, "non-empty string table");
32 luaM_free(L, L->strt.hash); 32 luaM_free(L, L->strt.hash);
33 LUA_ASSERT(L, L->udt.nuse==0, "non-empty udata table"); 33 LUA_ASSERT(L->udt.nuse==0, "non-empty udata table");
34 luaM_free(L, L->udt.hash); 34 luaM_free(L, L->udt.hash);
35} 35}
36 36
@@ -55,7 +55,7 @@ void luaS_resize (lua_State *L, stringtable *tb, int newsize) {
55 TString *next = p->nexthash; /* save next */ 55 TString *next = p->nexthash; /* save next */
56 unsigned long h = (tb == &L->strt) ? p->u.s.hash : IntPoint(p->u.d.value); 56 unsigned long h = (tb == &L->strt) ? p->u.s.hash : IntPoint(p->u.d.value);
57 int h1 = h&(newsize-1); /* new position */ 57 int h1 = h&(newsize-1); /* new position */
58 LUA_ASSERT(L, h%newsize == (h&(newsize-1)), 58 LUA_ASSERT(h%newsize == (h&(newsize-1)),
59 "a&(x-1) == a%x, for x power of 2"); 59 "a&(x-1) == a%x, for x power of 2");
60 p->nexthash = newhash[h1]; /* chain it in new position */ 60 p->nexthash = newhash[h1]; /* chain it in new position */
61 newhash[h1] = p; 61 newhash[h1] = p;