diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-12-11 19:31:14 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-12-11 19:31:14 -0200 |
commit | 8da245bfd2a767e1a738c2a85492d1f64d68f016 (patch) | |
tree | 9cb12a687b8051d9402d3c861c2c33d251bf7acd /lstring.c | |
parent | a2a2abcba4b3a221780a4499880aa16bf76e8204 (diff) | |
download | lua-8da245bfd2a767e1a738c2a85492d1f64d68f016.tar.gz lua-8da245bfd2a767e1a738c2a85492d1f64d68f016.tar.bz2 lua-8da245bfd2a767e1a738c2a85492d1f64d68f016.zip |
better to keep GC state numbers sequential, to optimize switch in
'singlestep'
Diffstat (limited to 'lstring.c')
-rw-r--r-- | lstring.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.c,v 2.13 2009/04/29 17:09:41 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 2.14 2009/12/11 19:14:59 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 | */ |
@@ -23,7 +23,7 @@ void luaS_resize (lua_State *L, int newsize) { | |||
23 | int i; | 23 | int i; |
24 | stringtable *tb = &G(L)->strt; | 24 | stringtable *tb = &G(L)->strt; |
25 | /* cannot resize while GC is traversing strings */ | 25 | /* cannot resize while GC is traversing strings */ |
26 | luaC_runtilstate(L, ~GCSsweepstring); | 26 | luaC_runtilstate(L, ~bitmask(GCSsweepstring)); |
27 | if (newsize > tb->size) { | 27 | if (newsize > tb->size) { |
28 | luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *); | 28 | luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *); |
29 | for (i = tb->size; i < newsize; i++) tb->hash[i] = NULL; | 29 | for (i = tb->size; i < newsize; i++) tb->hash[i] = NULL; |