aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-11-21 14:46:16 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-11-21 14:46:16 -0200
commit010bbd9d9c8c6e7d38062df79e886466de5a835a (patch)
tree393877f152dbc1d92c43422279549e9357e34cbd
parentbe00cd2a6b0f7d26dfc9ba74c262a5574f6521d0 (diff)
downloadlua-010bbd9d9c8c6e7d38062df79e886466de5a835a.tar.gz
lua-010bbd9d9c8c6e7d38062df79e886466de5a835a.tar.bz2
lua-010bbd9d9c8c6e7d38062df79e886466de5a835a.zip
simpler definition for incr_top
-rw-r--r--ldo.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/ldo.h b/ldo.h
index 5ee9e2ef..d2787b29 100644
--- a/ldo.h
+++ b/ldo.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.h,v 1.51 2002/08/07 14:35:55 roberto Exp roberto $ 2** $Id: ldo.h,v 1.52 2002/09/02 20:00:41 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,17 +13,13 @@
13#include "lzio.h" 13#include "lzio.h"
14 14
15 15
16/*
17** macro to increment stack top.
18** There must be always an empty slot at the L->stack.top
19*/
20#define incr_top(L) \
21 {if (L->top >= L->stack_last) luaD_growstack(L, 1); L->top++;}
22 16
23#define luaD_checkstack(L,n) \ 17#define luaD_checkstack(L,n) \
24 if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TObject)) \ 18 if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TObject)) \
25 luaD_growstack(L, n) 19 luaD_growstack(L, n)
26 20
21#define incr_top(L) {luaD_checkstack(L,1); L->top++;}
22
27#define savestack(L,p) ((char *)(p) - (char *)L->stack) 23#define savestack(L,p) ((char *)(p) - (char *)L->stack)
28#define restorestack(L,n) ((TObject *)((char *)L->stack + (n))) 24#define restorestack(L,n) ((TObject *)((char *)L->stack + (n)))
29 25