summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-10-20 15:56:21 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-10-20 15:56:21 -0200
commitf7670781cf67a4bfb0799d1800a87b2c4a19ad59 (patch)
tree94609bc437a744ccdb3ac05662705cb2a34cec4d
parentdf8b996bccd3830d6fe9d7ba80e8fccd6ac3cabf (diff)
downloadlua-f7670781cf67a4bfb0799d1800a87b2c4a19ad59.tar.gz
lua-f7670781cf67a4bfb0799d1800a87b2c4a19ad59.tar.bz2
lua-f7670781cf67a4bfb0799d1800a87b2c4a19ad59.zip
cleaner definition for 'luaC_condGC', using 'pre'/'pos' parameters
-rw-r--r--lgc.h9
-rw-r--r--lvm.c9
2 files changed, 9 insertions, 9 deletions
diff --git a/lgc.h b/lgc.h
index bd5020cb..4501db51 100644
--- a/lgc.h
+++ b/lgc.h
@@ -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) ( \
diff --git a/lvm.c b/lvm.c
index 17408082..e5ae82b8 100644
--- a/lvm.c
+++ b/lvm.c
@@ -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)