diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-03-20 09:52:32 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-03-20 09:52:32 -0300 |
commit | 63a614e1453b6b03b89b5d47efa476acd5f9d1d2 (patch) | |
tree | 203b7f497a7252e3afeb3651a7c6a09c5a3537b0 /ldo.h | |
parent | 48e732e07d21d585982d1c53be0d9031f021f014 (diff) | |
download | lua-63a614e1453b6b03b89b5d47efa476acd5f9d1d2.tar.gz lua-63a614e1453b6b03b89b5d47efa476acd5f9d1d2.tar.bz2 lua-63a614e1453b6b03b89b5d47efa476acd5f9d1d2.zip |
some improvements in stack control
Diffstat (limited to 'ldo.h')
-rw-r--r-- | ldo.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.h,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ | 2 | ** $Id: ldo.h,v 1.40 2002/01/30 17:27:53 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 | */ |
@@ -19,7 +19,12 @@ | |||
19 | #define incr_top(L) \ | 19 | #define incr_top(L) \ |
20 | {if (L->top >= L->stack_last) luaD_growstack(L, 1); L->top++;} | 20 | {if (L->top >= L->stack_last) luaD_growstack(L, 1); L->top++;} |
21 | 21 | ||
22 | #define luaD_checkstack(L,n) if (L->stack_last-(n)<=L->top) luaD_growstack(L, n) | 22 | #define luaD_checkstack(L,n) \ |
23 | if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TObject)) \ | ||
24 | luaD_growstack(L, n) | ||
25 | |||
26 | #define savestack(L,p) ((char *)(p) - (char *)L->stack) | ||
27 | #define restorestack(L,n) ((TObject *)((char *)L->stack + (n))) | ||
23 | 28 | ||
24 | 29 | ||
25 | void luaD_lineHook (lua_State *L, int line, lua_Hook linehook); | 30 | void luaD_lineHook (lua_State *L, int line, lua_Hook linehook); |