aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldo.h5
-rw-r--r--lgc.c4
-rw-r--r--lgc.h8
-rw-r--r--llimits.h7
4 files changed, 11 insertions, 13 deletions
diff --git a/ldo.h b/ldo.h
index 57695b0a..3e0d50a8 100644
--- a/ldo.h
+++ b/ldo.h
@@ -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);}
diff --git a/lgc.c b/lgc.c
index 509415c0..a314955a 100644
--- a/lgc.c
+++ b/lgc.c
@@ -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
diff --git a/lgc.h b/lgc.h
index 386239fe..abceca78 100644
--- a/lgc.h
+++ b/lgc.h
@@ -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))) \
diff --git a/llimits.h b/llimits.h
index 06e786ab..b6ccdb28 100644
--- a/llimits.h
+++ b/llimits.h
@@ -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