aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-09-11 17:15:31 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-09-11 17:15:31 -0300
commit06156e7575dee21026595a30dcf76f400c447a33 (patch)
treebeb9c0d833d3d742a37c72bce50a1a5f9fc5b85a
parent2e2c109daf6c18943984cf9d4cfbc2311186b87d (diff)
downloadlua-06156e7575dee21026595a30dcf76f400c447a33.tar.gz
lua-06156e7575dee21026595a30dcf76f400c447a33.tar.bz2
lua-06156e7575dee21026595a30dcf76f400c447a33.zip
detail (setmetatable do not need to use a back GC barrier)
-rw-r--r--lapi.c4
-rw-r--r--lgc.h6
2 files changed, 3 insertions, 7 deletions
diff --git a/lapi.c b/lapi.c
index f4a8beb4..1dacf222 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.187 2013/08/16 18:55:49 roberto Exp roberto $ 2** $Id: lapi.c,v 2.188 2013/08/27 18:53:35 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -849,7 +849,7 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) {
849 case LUA_TTABLE: { 849 case LUA_TTABLE: {
850 hvalue(obj)->metatable = mt; 850 hvalue(obj)->metatable = mt;
851 if (mt) { 851 if (mt) {
852 luaC_objbarrierback(L, gcvalue(obj), mt); 852 luaC_objbarrier(L, gcvalue(obj), mt);
853 luaC_checkfinalizer(L, gcvalue(obj), mt); 853 luaC_checkfinalizer(L, gcvalue(obj), mt);
854 } 854 }
855 break; 855 break;
diff --git a/lgc.h b/lgc.h
index 91e241a0..88bd556a 100644
--- a/lgc.h
+++ b/lgc.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.h,v 2.74 2013/09/11 14:09:55 roberto Exp roberto $ 2** $Id: lgc.h,v 2.75 2013/09/11 14:47:08 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*/
@@ -128,10 +128,6 @@
128 if (nolocal(obj2gco(o)), isblack(obj2gco(p)) && iswhite(obj2gco(o))) \ 128 if (nolocal(obj2gco(o)), isblack(obj2gco(p)) && iswhite(obj2gco(o))) \
129 luaC_barrier_(L,obj2gco(p),obj2gco(o)); } 129 luaC_barrier_(L,obj2gco(p),obj2gco(o)); }
130 130
131#define luaC_objbarrierback(L,p,o) \
132 { if (nolocal(obj2gco(o)), isblack(obj2gco(p)) && iswhite(obj2gco(o))) \
133 luaC_barrierback_(L,obj2gco(p)); }
134
135#define luaC_upvalbarrier(L,uv) \ 131#define luaC_upvalbarrier(L,uv) \
136 { if (iscollectable((uv)->v) && !upisopen(uv)) \ 132 { if (iscollectable((uv)->v) && !upisopen(uv)) \
137 luaC_upvalbarrier_(L,uv); } 133 luaC_upvalbarrier_(L,uv); }