diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-06-08 16:35:59 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-06-08 16:35:59 -0300 |
commit | 4a67e48611c1ffaa6d474e443c3c89849c8b6e5f (patch) | |
tree | 9eddf37f1a665067b4b88d588cc01b06077e705f | |
parent | 5cdec7d124e46c1409df8033f1b795a996dd00e4 (diff) | |
download | lua-4a67e48611c1ffaa6d474e443c3c89849c8b6e5f.tar.gz lua-4a67e48611c1ffaa6d474e443c3c89849c8b6e5f.tar.bz2 lua-4a67e48611c1ffaa6d474e443c3c89849c8b6e5f.zip |
new macro 'condmovestack' instead of 'condhardstacktests'
-rw-r--r-- | ldo.h | 5 | ||||
-rw-r--r-- | lgc.c | 4 | ||||
-rw-r--r-- | lgc.h | 8 | ||||
-rw-r--r-- | llimits.h | 7 |
4 files changed, 11 insertions, 13 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.h,v 2.11 2009/03/10 17:14:37 roberto Exp roberto $ | 2 | ** $Id: ldo.h,v 2.12 2009/04/17 14:28:06 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -15,8 +15,7 @@ | |||
15 | 15 | ||
16 | #define luaD_checkstack(L,n) \ | 16 | #define luaD_checkstack(L,n) \ |
17 | if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \ | 17 | if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \ |
18 | luaD_growstack(L, n); \ | 18 | luaD_growstack(L, n); else condmovestack(L); |
19 | else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); | ||
20 | 19 | ||
21 | 20 | ||
22 | #define incr_top(L) {L->top++; luaD_checkstack(L,0);} | 21 | #define incr_top(L) {L->top++; luaD_checkstack(L,0);} |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 2.52 2009/04/29 17:09:41 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 2.53 2009/05/21 20:06:11 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 | */ |
@@ -551,7 +551,7 @@ static void sweepthread (lua_State *L, lua_State *L1, int alive) { | |||
551 | if ((L1->stacksize - EXTRA_STACK) > goodsize) | 551 | if ((L1->stacksize - EXTRA_STACK) > goodsize) |
552 | luaD_reallocstack(L1, goodsize); | 552 | luaD_reallocstack(L1, goodsize); |
553 | else | 553 | else |
554 | condhardstacktests(luaD_reallocstack(L, L1->stacksize - EXTRA_STACK - 1)); | 554 | condmovestack(L1); |
555 | } | 555 | } |
556 | } | 556 | } |
557 | 557 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.h,v 2.19 2008/06/26 19:42:45 roberto Exp roberto $ | 2 | ** $Id: lgc.h,v 2.20 2009/04/28 19:04:36 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 | */ |
@@ -78,10 +78,8 @@ | |||
78 | #define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) | 78 | #define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) |
79 | 79 | ||
80 | 80 | ||
81 | #define luaC_checkGC(L) { \ | 81 | #define luaC_checkGC(L) \ |
82 | condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \ | 82 | {condmovestack(L); if (G(L)->totalbytes >= G(L)->GCthreshold) luaC_step(L);} |
83 | if (G(L)->totalbytes >= G(L)->GCthreshold) \ | ||
84 | luaC_step(L); } | ||
85 | 83 | ||
86 | 84 | ||
87 | #define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ | 85 | #define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llimits.h,v 1.69 2005/12/27 17:12:00 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.70 2006/09/11 14:07:24 roberto Exp roberto $ |
3 | ** Limits, basic types, and some other `installation-dependent' definitions | 3 | ** Limits, basic types, and some other `installation-dependent' definitions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -120,9 +120,10 @@ typedef lu_int32 Instruction; | |||
120 | ** macro to control inclusion of some hard tests on stack reallocation | 120 | ** macro to control inclusion of some hard tests on stack reallocation |
121 | */ | 121 | */ |
122 | #ifndef HARDSTACKTESTS | 122 | #ifndef HARDSTACKTESTS |
123 | #define condhardstacktests(x) ((void)0) | 123 | #define condmovestack(L) ((void)0) |
124 | #else | 124 | #else |
125 | #define condhardstacktests(x) x | 125 | #define condmovestack(L) /* realloc stack keeping its size */ \ |
126 | luaD_reallocstack((L), (L)->stacksize - EXTRA_STACK - 1) | ||
126 | #endif | 127 | #endif |
127 | 128 | ||
128 | #endif | 129 | #endif |