Browse Source

removed useless assertion (gcstate != GCSpause already implied by

other assertions) and wrong assertion (setmetatable uses this barrier
for tables too)
pull/9/head
Roberto Ierusalimschy 10 years ago
parent
commit
2898e2fd12
  1. 8
      lgc.c

8
lgc.c

@ -1,5 +1,5 @@
/*
** $Id: lgc.c,v 2.187 2014/07/18 13:36:14 roberto Exp roberto $
** $Id: lgc.c,v 2.188 2014/07/18 14:46:47 roberto Exp roberto $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@ -135,13 +135,13 @@ static int iscleared (global_State *g, const TValue *o) {
/*
** barrier that moves collector forward, that is, mark the white object
** being pointed by a black object.
** being pointed by a black object. (If in sweep phase, clear the black
** object to white [sweep it] to avoid other barrier calls for this
** same object.)
*/
void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) {
global_State *g = G(L);
lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o));
lua_assert(g->gcstate != GCSpause);
lua_assert(o->tt != LUA_TTABLE); /* tables use a back barrier */
if (keepinvariant(g)) /* must keep invariant? */
reallymarkobject(g, v); /* restore invariant */
else { /* sweep phase */

Loading…
Cancel
Save