From a2a2abcba4b3a221780a4499880aa16bf76e8204 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 11 Dec 2009 17:14:59 -0200 Subject: new function 'luaC_runtilstate' to advance GC until a "valid" state --- lstring.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lstring.c') diff --git a/lstring.c b/lstring.c index 281d35fd..b79cdb61 100644 --- a/lstring.c +++ b/lstring.c @@ -1,5 +1,5 @@ /* -** $Id: lstring.c,v 2.12 2009/04/17 14:40:13 roberto Exp roberto $ +** $Id: lstring.c,v 2.13 2009/04/29 17:09:41 roberto Exp roberto $ ** String table (keeps all strings handled by Lua) ** See Copyright Notice in lua.h */ @@ -22,8 +22,8 @@ void luaS_resize (lua_State *L, int newsize) { int i; stringtable *tb = &G(L)->strt; - if (G(L)->gcstate == GCSsweepstring) - return; /* cannot resize during GC traverse */ + /* cannot resize while GC is traversing strings */ + luaC_runtilstate(L, ~GCSsweepstring); if (newsize > tb->size) { luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *); for (i = tb->size; i < newsize; i++) tb->hash[i] = NULL; -- cgit v1.2.3-55-g6feb