From 9db1942bac5fb509c6e46ccc825351a6be546792 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 4 Dec 2003 15:22:42 -0200 Subject: sweep of strings also incremental --- lstring.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lstring.c') diff --git a/lstring.c b/lstring.c index db0b98bf..5495542d 100644 --- a/lstring.c +++ b/lstring.c @@ -1,5 +1,5 @@ /* -** $Id: lstring.c,v 1.82 2003/12/03 12:30:41 roberto Exp roberto $ +** $Id: lstring.c,v 1.83 2003/12/03 20:03:07 roberto Exp roberto $ ** String table (keeps all strings handled by Lua) ** See Copyright Notice in lua.h */ @@ -25,9 +25,12 @@ void luaS_freeall (lua_State *L) { void luaS_resize (lua_State *L, int newsize) { - GCObject **newhash = luaM_newvector(L, newsize, GCObject *); - stringtable *tb = &G(L)->strt; + GCObject **newhash; + stringtable *tb; int i; + if (G(L)->sweepstrgc > 0) return; /* cannot resize during GC traverse */ + newhash = luaM_newvector(L, newsize, GCObject *); + tb = &G(L)->strt; for (i=0; isize; i++) { -- cgit v1.2.3-55-g6feb