diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-19 11:44:19 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-19 11:44:19 -0300 |
| commit | 2898e2fd12db741c58813671e56e628039d9bdc7 (patch) | |
| tree | da338424847dc51cc1a9bebe5a91c558556a112e | |
| parent | 8704fca0c9f7a0c1c916d13ea03f6253daa6b13a (diff) | |
| download | lua-2898e2fd12db741c58813671e56e628039d9bdc7.tar.gz lua-2898e2fd12db741c58813671e56e628039d9bdc7.tar.bz2 lua-2898e2fd12db741c58813671e56e628039d9bdc7.zip | |
removed useless assertion (gcstate != GCSpause already implied by
other assertions) and wrong assertion (setmetatable uses this barrier
for tables too)
| -rw-r--r-- | lgc.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lgc.c,v 2.187 2014/07/18 13:36:14 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 2.188 2014/07/18 14:46:47 roberto Exp roberto $ |
| 3 | ** Garbage Collector | 3 | ** Garbage Collector |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -135,13 +135,13 @@ static int iscleared (global_State *g, const TValue *o) { | |||
| 135 | 135 | ||
| 136 | /* | 136 | /* |
| 137 | ** barrier that moves collector forward, that is, mark the white object | 137 | ** barrier that moves collector forward, that is, mark the white object |
| 138 | ** being pointed by a black object. | 138 | ** being pointed by a black object. (If in sweep phase, clear the black |
| 139 | ** object to white [sweep it] to avoid other barrier calls for this | ||
| 140 | ** same object.) | ||
| 139 | */ | 141 | */ |
| 140 | void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) { | 142 | void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) { |
| 141 | global_State *g = G(L); | 143 | global_State *g = G(L); |
| 142 | lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); | 144 | lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); |
| 143 | lua_assert(g->gcstate != GCSpause); | ||
| 144 | lua_assert(o->tt != LUA_TTABLE); /* tables use a back barrier */ | ||
| 145 | if (keepinvariant(g)) /* must keep invariant? */ | 145 | if (keepinvariant(g)) /* must keep invariant? */ |
| 146 | reallymarkobject(g, v); /* restore invariant */ | 146 | reallymarkobject(g, v); /* restore invariant */ |
| 147 | else { /* sweep phase */ | 147 | else { /* sweep phase */ |
