From 995775e1cb2ffeec96a07be93c22a7710b3ae41c Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 24 May 1999 14:53:03 -0300 Subject: [PATCH] tighter control on the stack when debugging --- ldo.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ldo.c b/ldo.c index c1076fdf..2216d97a 100644 --- a/ldo.c +++ b/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 1.41 1999/03/11 18:59:19 roberto Exp roberto $ +** $Id: ldo.c,v 1.42 1999/05/10 13:54:01 roberto Exp roberto $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -37,6 +37,12 @@ #define STACK_UNIT 128 +#ifdef DEBUG +#undef STACK_UNIT +#define STACK_UNIT 2 +#endif + + void luaD_init (void) { L->stack.stack = luaM_newvector(STACK_UNIT, TObject); L->stack.top = L->stack.stack; @@ -80,16 +86,14 @@ void luaD_adjusttop (StkId newtop) { /* ** Open a hole below "nelems" from the L->stack.top. */ -void luaD_openstack (int nelems) -{ +void luaD_openstack (int nelems) { luaO_memup(L->stack.top-nelems+1, L->stack.top-nelems, nelems*sizeof(TObject)); incr_top; } -void luaD_lineHook (int line) -{ +void luaD_lineHook (int line) { struct C_Lua_Stack oldCLS = L->Cstack; StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->stack.top-L->stack.stack; L->Cstack.num = 0; @@ -99,8 +103,7 @@ void luaD_lineHook (int line) } -void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn) -{ +void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn) { struct C_Lua_Stack oldCLS = L->Cstack; StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->stack.top-L->stack.stack; L->Cstack.num = 0;