aboutsummaryrefslogtreecommitdiff
path: root/ldo.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-20 09:52:32 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-20 09:52:32 -0300
commit63a614e1453b6b03b89b5d47efa476acd5f9d1d2 (patch)
tree203b7f497a7252e3afeb3651a7c6a09c5a3537b0 /ldo.h
parent48e732e07d21d585982d1c53be0d9031f021f014 (diff)
downloadlua-63a614e1453b6b03b89b5d47efa476acd5f9d1d2.tar.gz
lua-63a614e1453b6b03b89b5d47efa476acd5f9d1d2.tar.bz2
lua-63a614e1453b6b03b89b5d47efa476acd5f9d1d2.zip
some improvements in stack control
Diffstat (limited to 'ldo.h')
-rw-r--r--ldo.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/ldo.h b/ldo.h
index c3dd7cfa..e25d9c09 100644
--- a/ldo.h
+++ b/ldo.h
@@ -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
25void luaD_lineHook (lua_State *L, int line, lua_Hook linehook); 30void luaD_lineHook (lua_State *L, int line, lua_Hook linehook);