commit 995775e1cb2ffeec96a07be93c22a7710b3ae41c
parent abfc885079aef8cecf0235265ff173db22172ea5
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 24 May 1999 14:52:41 -0300
tighter control on the stack when debugging
Diffstat:
M | ldo.c | | | 17 | ++++++++++------- |
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git 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;