aboutsummaryrefslogtreecommitdiff
path: root/lstate.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-25 20:14:54 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-25 20:14:54 -0200
commit50e29525936be4891f9db090f293432913b5f7c0 (patch)
tree8e487b87f82761e15cd096ac345354f57f38fedc /lstate.h
parentb217ae644e3a83def93be2fe742e2cd0970e1a5f (diff)
downloadlua-50e29525936be4891f9db090f293432913b5f7c0.tar.gz
lua-50e29525936be4891f9db090f293432913b5f7c0.tar.bz2
lua-50e29525936be4891f9db090f293432913b5f7c0.zip
first version of dynamic stack
Diffstat (limited to 'lstate.h')
-rw-r--r--lstate.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/lstate.h b/lstate.h
index a90daa5f..684c40b4 100644
--- a/lstate.h
+++ b/lstate.h
@@ -64,8 +64,17 @@ struct lua_longjmp; /* defined in ldo.c */
64 64
65#define RESERVED_STACK_PREFIX 3 65#define RESERVED_STACK_PREFIX 3
66 66
67/* space to handle stack overflow errors */ 67
68#define EXTRA_STACK (2*LUA_MINSTACK) 68/* space to handle TM calls */
69#define EXTRA_STACK 4
70
71
72#define BASIC_CI_SIZE 6
73
74#define BASIC_STACK_SIZE (2*LUA_MINSTACK)
75
76#define DEFAULT_MAXSTACK 12000
77
69 78
70 79
71 80
@@ -84,6 +93,7 @@ typedef struct CallInfo {
84 const Instruction *savedpc; 93 const Instruction *savedpc;
85 StkId top; /* top for this function (when it's a Lua function) */ 94 StkId top; /* top for this function (when it's a Lua function) */
86 const Instruction **pc; 95 const Instruction **pc;
96 StkId *pb;
87 /* extra information for line tracing */ 97 /* extra information for line tracing */
88 int lastpc; /* last pc traced */ 98 int lastpc; /* last pc traced */
89 int line; /* current line */ 99 int line; /* current line */
@@ -124,6 +134,7 @@ struct lua_State {
124 StkId stack_last; /* last free slot in the stack */ 134 StkId stack_last; /* last free slot in the stack */
125 StkId stack; /* stack base */ 135 StkId stack; /* stack base */
126 int stacksize; 136 int stacksize;
137 int maxstacksize;
127 CallInfo *end_ci; /* points after end of ci array*/ 138 CallInfo *end_ci; /* points after end of ci array*/
128 CallInfo *base_ci; /* array of CallInfo's */ 139 CallInfo *base_ci; /* array of CallInfo's */
129 int size_ci; /* size of array `base_ci' */ 140 int size_ci; /* size of array `base_ci' */