diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-10-20 15:56:21 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-10-20 15:56:21 -0200 |
commit | f7670781cf67a4bfb0799d1800a87b2c4a19ad59 (patch) | |
tree | 94609bc437a744ccdb3ac05662705cb2a34cec4d | |
parent | df8b996bccd3830d6fe9d7ba80e8fccd6ac3cabf (diff) | |
download | lua-f7670781cf67a4bfb0799d1800a87b2c4a19ad59.tar.gz lua-f7670781cf67a4bfb0799d1800a87b2c4a19ad59.tar.bz2 lua-f7670781cf67a4bfb0799d1800a87b2c4a19ad59.zip |
cleaner definition for 'luaC_condGC', using 'pre'/'pos' parameters
-rw-r--r-- | lgc.h | 9 | ||||
-rw-r--r-- | lvm.c | 9 |
2 files changed, 9 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.h,v 2.86 2014/10/25 11:50:46 roberto Exp roberto $ | 2 | ** $Id: lgc.h,v 2.87 2015/08/03 19:40:42 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 | */ |
@@ -101,9 +101,10 @@ | |||
101 | #define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) | 101 | #define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) |
102 | 102 | ||
103 | 103 | ||
104 | #define luaC_condGC(L,c) \ | 104 | #define luaC_condGC(L,pre,pos) \ |
105 | {if (G(L)->GCdebt > 0) {c;}; condchangemem(L);} | 105 | {if (G(L)->GCdebt > 0) { pre; luaC_step(L); pos;}; condchangemem(L);} |
106 | #define luaC_checkGC(L) luaC_condGC(L, luaC_step(L);) | 106 | |
107 | #define luaC_checkGC(L) luaC_condGC(L,,) | ||
107 | 108 | ||
108 | 109 | ||
109 | #define luaC_barrier(L,p,v) ( \ | 110 | #define luaC_barrier(L,p,v) ( \ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.253 2015/09/17 15:51:05 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.254 2015/10/20 17:41:35 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -733,10 +733,9 @@ void luaV_finishOp (lua_State *L) { | |||
733 | #define Protect(x) { {x;}; base = ci->u.l.base; } | 733 | #define Protect(x) { {x;}; base = ci->u.l.base; } |
734 | 734 | ||
735 | #define checkGC(L,c) \ | 735 | #define checkGC(L,c) \ |
736 | Protect( luaC_condGC(L,{L->top = (c); /* limit of live values */ \ | 736 | { luaC_condGC(L, L->top = (c), /* limit of live values */ \ |
737 | luaC_step(L); \ | 737 | Protect(L->top = ci->top)); /* restore top */ \ |
738 | L->top = ci->top;}) /* restore top */ \ | 738 | luai_threadyield(L); } |
739 | luai_threadyield(L); ) | ||
740 | 739 | ||
741 | 740 | ||
742 | #define vmdispatch(o) switch(o) | 741 | #define vmdispatch(o) switch(o) |