|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
-** $Id: lgc.c,v 2.203 2015/03/04 13:31:21 roberto Exp roberto $
|
|
|
|
|
|
+** $Id: lgc.c,v 2.204 2015/03/04 13:51:55 roberto Exp roberto $
|
|
** Garbage Collector
|
|
** Garbage Collector
|
|
** See Copyright Notice in lua.h
|
|
** See Copyright Notice in lua.h
|
|
*/
|
|
*/
|
|
@@ -977,19 +977,6 @@ void luaC_freeallobjects (lua_State *L) {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/*
|
|
|
|
-** Clear API string cache. (Entries cannot be empty, so fill them with
|
|
|
|
-** a non-collectable string.)
|
|
|
|
-*/
|
|
|
|
-static void clearapihash (global_State *g) {
|
|
|
|
- int i;
|
|
|
|
- for (i = 0; i < STRCACHE_SIZE; i++) {
|
|
|
|
- if (iswhite(g->strcache[i])) /* will entry be collected? */
|
|
|
|
- g->strcache[i] = g->memerrmsg; /* replace it with something fixed */
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
static l_mem atomic (lua_State *L) {
|
|
static l_mem atomic (lua_State *L) {
|
|
global_State *g = G(L);
|
|
global_State *g = G(L);
|
|
l_mem work;
|
|
l_mem work;
|
|
@@ -1030,7 +1017,7 @@ static l_mem atomic (lua_State *L) {
|
|
/* clear values from resurrected weak tables */
|
|
/* clear values from resurrected weak tables */
|
|
clearvalues(g, g->weak, origweak);
|
|
clearvalues(g, g->weak, origweak);
|
|
clearvalues(g, g->allweak, origall);
|
|
clearvalues(g, g->allweak, origall);
|
|
- clearapihash(g);
|
|
|
|
|
|
+ luaS_clearcache(g);
|
|
g->currentwhite = cast_byte(otherwhite(g)); /* flip current white */
|
|
g->currentwhite = cast_byte(otherwhite(g)); /* flip current white */
|
|
work += g->GCmemtrav; /* complete counting */
|
|
work += g->GCmemtrav; /* complete counting */
|
|
return work; /* estimate of memory marked by 'atomic' */
|
|
return work; /* estimate of memory marked by 'atomic' */
|