summaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-12-10 10:13:36 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-12-10 10:13:36 -0200
commit47fc57a2529c83376883f36954082cfe80ae588f (patch)
treec2e57e2f9f7d78279144bfd9cbd04a3b1b131f12 /lstring.c
parent4d5fe1f54bc00850f77a7c42f9e95d0ff3f1ab5b (diff)
downloadlua-github-47fc57a2529c83376883f36954082cfe80ae588f.tar.gz
`TObject' renamed to `TValue' + other name changes and better assertions
for incremental garbage collection
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lstring.c b/lstring.c
index 203c4c98..8de7d2b3 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstring.c,v 1.84 2003/12/04 17:22:42 roberto Exp roberto $
+** $Id: lstring.c,v 1.85 2003/12/09 16:56:11 roberto Exp roberto $
** String table (keeps all strings handled by Lua)
** See Copyright Notice in lua.h
*/
@@ -37,7 +37,7 @@ void luaS_resize (lua_State *L, int newsize) {
GCObject *p = tb->hash[i];
while (p) { /* for each node in the list */
GCObject *next = p->gch.next; /* save next */
- unsigned int h = gcotots(p)->tsv.hash;
+ unsigned int h = gco2ts(p)->hash;
int h1 = lmod(h, newsize); /* new position */
lua_assert(cast(int, h%newsize) == lmod(h, newsize));
p->gch.next = newhash[h1]; /* chain it */
@@ -65,7 +65,7 @@ static TString *newlstr (lua_State *L, const char *str, size_t l,
tb = &G(L)->strt;
h = lmod(h, tb->size);
ts->tsv.next = tb->hash[h]; /* chain new entry */
- tb->hash[h] = valtogco(ts);
+ tb->hash[h] = obj2gco(ts);
tb->nuse++;
if (tb->nuse > cast(lu_int32, tb->size) && tb->size <= MAX_INT/2)
luaS_resize(L, tb->size*2); /* too crowded */
@@ -83,7 +83,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)];
o != NULL;
o = o->gch.next) {
- TString *ts = gcotots(o);
+ TString *ts = rawgco2ts(o);
if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) {
/* string may be dead */
if (isdead(G(L), o)) changewhite(o);
@@ -103,7 +103,7 @@ Udata *luaS_newudata (lua_State *L, size_t s) {
u->uv.metatable = NULL;
/* chain it on udata list */
u->uv.next = G(L)->firstudata->uv.next;
- G(L)->firstudata->uv.next = valtogco(u);
+ G(L)->firstudata->uv.next = obj2gco(u);
return u;
}