diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-09-11 17:15:31 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-09-11 17:15:31 -0300 |
commit | 06156e7575dee21026595a30dcf76f400c447a33 (patch) | |
tree | beb9c0d833d3d742a37c72bce50a1a5f9fc5b85a | |
parent | 2e2c109daf6c18943984cf9d4cfbc2311186b87d (diff) | |
download | lua-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.c | 4 | ||||
-rw-r--r-- | lgc.h | 6 |
2 files changed, 3 insertions, 7 deletions
@@ -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; |
@@ -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); } |