diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-19 11:20:30 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-19 11:20:30 -0200 |
commit | 4ac58853dc820127a11a14ed8bde1fae9458369e (patch) | |
tree | e8179692c97e935ba921c8ebd17abf9c8510d89e /ltable.c | |
parent | f2c451d7455aad3496f32dfa2bfca7f7e8b5376d (diff) | |
download | lua-4ac58853dc820127a11a14ed8bde1fae9458369e.tar.gz lua-4ac58853dc820127a11a14ed8bde1fae9458369e.tar.bz2 lua-4ac58853dc820127a11a14ed8bde1fae9458369e.zip |
thead-specific state separated from "global" state
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 1.63 2001/01/10 18:56:11 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 1.64 2001/01/18 15:59:09 roberto Exp roberto $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -144,7 +144,7 @@ void luaH_remove (Hash *t, TObject *key) { | |||
144 | n += t->size; | 144 | n += t->size; |
145 | } | 145 | } |
146 | setnvalue(key, n); | 146 | setnvalue(key, n); |
147 | LUA_ASSERT(luaH_mainposition(t, key) == mp, "cannot change hash"); | 147 | lua_assert(luaH_mainposition(t, key) == mp); |
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
@@ -167,8 +167,8 @@ static void setnodevector (lua_State *L, Hash *t, luint32 size) { | |||
167 | Hash *luaH_new (lua_State *L, int size) { | 167 | Hash *luaH_new (lua_State *L, int size) { |
168 | Hash *t = luaM_new(L, Hash); | 168 | Hash *t = luaM_new(L, Hash); |
169 | t->htag = TagDefault; | 169 | t->htag = TagDefault; |
170 | t->next = L->roottable; | 170 | t->next = G(L)->roottable; |
171 | L->roottable = t; | 171 | G(L)->roottable = t; |
172 | t->mark = t; | 172 | t->mark = t; |
173 | t->size = 0; | 173 | t->size = 0; |
174 | t->node = NULL; | 174 | t->node = NULL; |
@@ -201,7 +201,7 @@ static void rehash (lua_State *L, Hash *t) { | |||
201 | Node *nold = t->node; | 201 | Node *nold = t->node; |
202 | int nelems = numuse(t); | 202 | int nelems = numuse(t); |
203 | int i; | 203 | int i; |
204 | LUA_ASSERT(nelems<=oldsize, "wrong count"); | 204 | lua_assert(nelems<=oldsize); |
205 | if (nelems >= oldsize-oldsize/4) /* using more than 3/4? */ | 205 | if (nelems >= oldsize-oldsize/4) /* using more than 3/4? */ |
206 | setnodevector(L, t, (luint32)oldsize*2); | 206 | setnodevector(L, t, (luint32)oldsize*2); |
207 | else if (nelems <= oldsize/4 && /* less than 1/4? */ | 207 | else if (nelems <= oldsize/4 && /* less than 1/4? */ |