detail (setmetatable do not need to use a back GC barrier)
This commit is contained in:
4
lapi.c
4
lapi.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lapi.c,v 2.187 2013/08/16 18:55:49 roberto Exp roberto $
|
** $Id: lapi.c,v 2.188 2013/08/27 18:53:35 roberto Exp roberto $
|
||||||
** Lua API
|
** Lua API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -849,7 +849,7 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) {
|
|||||||
case LUA_TTABLE: {
|
case LUA_TTABLE: {
|
||||||
hvalue(obj)->metatable = mt;
|
hvalue(obj)->metatable = mt;
|
||||||
if (mt) {
|
if (mt) {
|
||||||
luaC_objbarrierback(L, gcvalue(obj), mt);
|
luaC_objbarrier(L, gcvalue(obj), mt);
|
||||||
luaC_checkfinalizer(L, gcvalue(obj), mt);
|
luaC_checkfinalizer(L, gcvalue(obj), mt);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
6
lgc.h
6
lgc.h
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lgc.h,v 2.74 2013/09/11 14:09:55 roberto Exp roberto $
|
** $Id: lgc.h,v 2.75 2013/09/11 14:47:08 roberto Exp roberto $
|
||||||
** Garbage Collector
|
** Garbage Collector
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -128,10 +128,6 @@
|
|||||||
if (nolocal(obj2gco(o)), isblack(obj2gco(p)) && iswhite(obj2gco(o))) \
|
if (nolocal(obj2gco(o)), isblack(obj2gco(p)) && iswhite(obj2gco(o))) \
|
||||||
luaC_barrier_(L,obj2gco(p),obj2gco(o)); }
|
luaC_barrier_(L,obj2gco(p),obj2gco(o)); }
|
||||||
|
|
||||||
#define luaC_objbarrierback(L,p,o) \
|
|
||||||
{ if (nolocal(obj2gco(o)), isblack(obj2gco(p)) && iswhite(obj2gco(o))) \
|
|
||||||
luaC_barrierback_(L,obj2gco(p)); }
|
|
||||||
|
|
||||||
#define luaC_upvalbarrier(L,uv) \
|
#define luaC_upvalbarrier(L,uv) \
|
||||||
{ if (iscollectable((uv)->v) && !upisopen(uv)) \
|
{ if (iscollectable((uv)->v) && !upisopen(uv)) \
|
||||||
luaC_upvalbarrier_(L,uv); }
|
luaC_upvalbarrier_(L,uv); }
|
||||||
|
|||||||
Reference in New Issue
Block a user