From 50e29525936be4891f9db090f293432913b5f7c0 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 25 Jan 2002 20:14:54 -0200 Subject: first version of dynamic stack --- lstate.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lstate.h') 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 */ #define RESERVED_STACK_PREFIX 3 -/* space to handle stack overflow errors */ -#define EXTRA_STACK (2*LUA_MINSTACK) + +/* space to handle TM calls */ +#define EXTRA_STACK 4 + + +#define BASIC_CI_SIZE 6 + +#define BASIC_STACK_SIZE (2*LUA_MINSTACK) + +#define DEFAULT_MAXSTACK 12000 + @@ -84,6 +93,7 @@ typedef struct CallInfo { const Instruction *savedpc; StkId top; /* top for this function (when it's a Lua function) */ const Instruction **pc; + StkId *pb; /* extra information for line tracing */ int lastpc; /* last pc traced */ int line; /* current line */ @@ -124,6 +134,7 @@ struct lua_State { StkId stack_last; /* last free slot in the stack */ StkId stack; /* stack base */ int stacksize; + int maxstacksize; CallInfo *end_ci; /* points after end of ci array*/ CallInfo *base_ci; /* array of CallInfo's */ int size_ci; /* size of array `base_ci' */ -- cgit v1.2.3-55-g6feb