mirror of
https://github.com/lua/lua.git
synced 2025-01-14 05:43:00 +08:00
removed useless assertion (gcstate != GCSpause already implied by
other assertions) and wrong assertion (setmetatable uses this barrier for tables too)
This commit is contained in:
parent
8704fca0c9
commit
2898e2fd12
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
|
** Garbage Collector
|
||||||
** See Copyright Notice in lua.h
|
** 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
|
** 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) {
|
void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) {
|
||||||
global_State *g = G(L);
|
global_State *g = G(L);
|
||||||
lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o));
|
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? */
|
if (keepinvariant(g)) /* must keep invariant? */
|
||||||
reallymarkobject(g, v); /* restore invariant */
|
reallymarkobject(g, v); /* restore invariant */
|
||||||
else { /* sweep phase */
|
else { /* sweep phase */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user