1
0
mirror of https://github.com/lua/lua.git synced 2025-02-04 06:13:04 +08:00

comments were wrong (not updated about several changes)

This commit is contained in:
Roberto Ierusalimschy 2014-12-20 11:58:15 -02:00
parent eb45f3a9b6
commit 88ef06f4f3

12
lgc.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lgc.c,v 2.199 2014/10/30 18:53:28 roberto Exp roberto $ ** $Id: lgc.c,v 2.200 2014/11/02 19:19:04 roberto Exp roberto $
** Garbage Collector ** Garbage Collector
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -705,10 +705,10 @@ static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count);
/* /*
** sweep at most 'count' elements from a list of GCObjects erasing dead ** sweep at most 'count' elements from a list of GCObjects erasing dead
** objects, where a dead (not alive) object is one marked with the "old" ** objects, where a dead object is one marked with the old (non current)
** (non current) white and not fixed; change all non-dead objects back ** white; change all non-dead objects back to white, preparing for next
** to white, preparing for next collection cycle. ** collection cycle. Return where to continue the traversal or NULL if
** When object is a thread, sweep its list of open upvalues too. ** list is finished.
*/ */
static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) { static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {
global_State *g = G(L); global_State *g = G(L);
@ -721,7 +721,7 @@ static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {
*p = curr->next; /* remove 'curr' from list */ *p = curr->next; /* remove 'curr' from list */
freeobj(L, curr); /* erase 'curr' */ freeobj(L, curr); /* erase 'curr' */
} }
else { /* update marks */ else { /* change mark to 'white' */
curr->marked = cast_byte((marked & maskcolors) | white); curr->marked = cast_byte((marked & maskcolors) | white);
p = &curr->next; /* go to next element */ p = &curr->next; /* go to next element */
} }