diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-12-09 14:56:11 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-12-09 14:56:11 -0200 |
commit | df429f163ada6581d921e7f51b016f1abfeefddd (patch) | |
tree | a1af3ce961377e6548074f706f65e2b34181918f /lstring.c | |
parent | fe595a45c246faf2cf12084e7aac4b772f8f72da (diff) | |
download | lua-df429f163ada6581d921e7f51b016f1abfeefddd.tar.gz lua-df429f163ada6581d921e7f51b016f1abfeefddd.tar.bz2 lua-df429f163ada6581d921e7f51b016f1abfeefddd.zip |
First version of incremental GC
Diffstat (limited to 'lstring.c')
-rw-r--r-- | lstring.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.c,v 1.83 2003/12/03 20:03:07 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 1.84 2003/12/04 17:22:42 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 | */ |
@@ -84,8 +84,11 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { | |||
84 | o != NULL; | 84 | o != NULL; |
85 | o = o->gch.next) { | 85 | o = o->gch.next) { |
86 | TString *ts = gcotots(o); | 86 | TString *ts = gcotots(o); |
87 | if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) | 87 | if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) { |
88 | /* string may be dead */ | ||
89 | if (isdead(G(L), o)) changewhite(o); | ||
88 | return ts; | 90 | return ts; |
91 | } | ||
89 | } | 92 | } |
90 | return newlstr(L, str, l, h); /* not found */ | 93 | return newlstr(L, str, l, h); /* not found */ |
91 | } | 94 | } |