diff options
Diffstat (limited to 'ldo.h')
-rw-r--r-- | ldo.h | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.h,v 1.52 2002/09/02 20:00:41 roberto Exp roberto $ | 2 | ** $Id: ldo.h,v 1.53 2002/11/21 16:46:16 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 | */ |
@@ -13,10 +13,21 @@ | |||
13 | #include "lzio.h" | 13 | #include "lzio.h" |
14 | 14 | ||
15 | 15 | ||
16 | /* | ||
17 | ** macro to control inclusion of some hard tests on stack reallocation | ||
18 | */ | ||
19 | #ifndef CONDHARDSTACKTESTS | ||
20 | #define condhardstacktests(x) { /* empty */ } | ||
21 | #else | ||
22 | #define condhardstacktests(x) x | ||
23 | #endif | ||
24 | |||
16 | 25 | ||
17 | #define luaD_checkstack(L,n) \ | 26 | #define luaD_checkstack(L,n) \ |
18 | if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TObject)) \ | 27 | if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TObject)) \ |
19 | luaD_growstack(L, n) | 28 | luaD_growstack(L, n); \ |
29 | else condhardstacktests(luaD_reallocstack(L, L->stacksize)); | ||
30 | |||
20 | 31 | ||
21 | #define incr_top(L) {luaD_checkstack(L,1); L->top++;} | 32 | #define incr_top(L) {luaD_checkstack(L,1); L->top++;} |
22 | 33 | ||