aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-11-21 15:19:11 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-11-21 15:19:11 -0200
commit5142e630bf91e2353f4397e03593ab56b3a07b86 (patch)
tree1402e556c77f5c45e956ea6cd3192cffaf2e28d1 /lgc.c
parent010bbd9d9c8c6e7d38062df79e886466de5a835a (diff)
downloadlua-5142e630bf91e2353f4397e03593ab56b3a07b86.tar.gz
lua-5142e630bf91e2353f4397e03593ab56b3a07b86.tar.bz2
lua-5142e630bf91e2353f4397e03593ab56b3a07b86.zip
new macro `condhardstacktests' to control hard stack tests
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lgc.c b/lgc.c
index d77b1a47..f14bfb25 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 1.160 2002/11/21 14:17:15 roberto Exp roberto $ 2** $Id: lgc.c,v 1.161 2002/11/21 15:46:20 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*/
@@ -224,9 +224,11 @@ static void checkstacksizes (lua_State *L, StkId max) {
224 int used = L->ci - L->base_ci; /* number of `ci' in use */ 224 int used = L->ci - L->base_ci; /* number of `ci' in use */
225 if (4*used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci) 225 if (4*used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci)
226 luaD_reallocCI(L, L->size_ci/2); /* still big enough... */ 226 luaD_reallocCI(L, L->size_ci/2); /* still big enough... */
227 else condhardstacktests(luaD_reallocCI(L, L->size_ci));
227 used = max - L->stack; /* part of stack in use */ 228 used = max - L->stack; /* part of stack in use */
228 if (4*used < L->stacksize && 2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize) 229 if (4*used < L->stacksize && 2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize)
229 luaD_reallocstack(L, L->stacksize/2); /* still big enough... */ 230 luaD_reallocstack(L, L->stacksize/2); /* still big enough... */
231 else condhardstacktests(luaD_reallocstack(L, L->stacksize));
230} 232}
231 233
232 234