diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-12-03 18:03:07 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-12-03 18:03:07 -0200 |
commit | c6eac44a9420a26a2f8907dcd5266a6aecdb18ea (patch) | |
tree | acbf11560fe8aee5dddf37ff52b9fcaa6e697ca6 /lstring.c | |
parent | 8878554b854009066eeccfe7b17e6e019c69758a (diff) | |
download | lua-c6eac44a9420a26a2f8907dcd5266a6aecdb18ea.tar.gz lua-c6eac44a9420a26a2f8907dcd5266a6aecdb18ea.tar.bz2 lua-c6eac44a9420a26a2f8907dcd5266a6aecdb18ea.zip |
two different white flags (to distinguish dead elements from new ones)
Diffstat (limited to 'lstring.c')
-rw-r--r-- | lstring.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.c,v 1.81 2003/12/01 18:22:56 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 1.82 2003/12/03 12:30:41 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 | */ |
@@ -54,7 +54,7 @@ static TString *newlstr (lua_State *L, const char *str, size_t l, | |||
54 | stringtable *tb; | 54 | stringtable *tb; |
55 | ts->tsv.len = l; | 55 | ts->tsv.len = l; |
56 | ts->tsv.hash = h; | 56 | ts->tsv.hash = h; |
57 | ts->tsv.marked = 0; | 57 | ts->tsv.marked = luaC_white(G(L)); |
58 | ts->tsv.tt = LUA_TSTRING; | 58 | ts->tsv.tt = LUA_TSTRING; |
59 | ts->tsv.reserved = 0; | 59 | ts->tsv.reserved = 0; |
60 | memcpy(ts+1, str, l*sizeof(char)); | 60 | memcpy(ts+1, str, l*sizeof(char)); |
@@ -91,7 +91,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { | |||
91 | Udata *luaS_newudata (lua_State *L, size_t s) { | 91 | Udata *luaS_newudata (lua_State *L, size_t s) { |
92 | Udata *u; | 92 | Udata *u; |
93 | u = cast(Udata *, luaM_malloc(L, sizeudata(s))); | 93 | u = cast(Udata *, luaM_malloc(L, sizeudata(s))); |
94 | u->uv.marked = 0; /* is not finalized */ | 94 | u->uv.marked = luaC_white(G(L)); /* is not finalized */ |
95 | u->uv.tt = LUA_TUSERDATA; | 95 | u->uv.tt = LUA_TUSERDATA; |
96 | u->uv.len = s; | 96 | u->uv.len = s; |
97 | u->uv.metatable = NULL; | 97 | u->uv.metatable = NULL; |