From 3ca9af51a4f060cf2178901a67a21f8269af3224 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 11 Jul 2006 12:53:29 -0300 Subject: emergency garbage collector (core forces a GC when allocation fails) --- ldebug.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index 4fa42ac9..66a32f37 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.28 2005/11/01 16:08:52 roberto Exp roberto $ +** $Id: ldebug.c,v 2.29 2005/12/22 16:19:56 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -128,8 +128,10 @@ LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) { CallInfo *ci = L->base_ci + ar->i_ci; const char *name = findlocal(L, ci, n); lua_lock(L); - if (name) - luaA_pushobject(L, ci->base + (n - 1)); + if (name) { + setobj2s(L, L->top, ci->base + (n - 1)); + api_incr_top(L); + } lua_unlock(L); return name; } @@ -177,16 +179,17 @@ static void info_tailcall (lua_Debug *ar) { static void collectvalidlines (lua_State *L, Closure *f) { if (f == NULL || f->c.isC) { setnilvalue(L->top); + incr_top(L); } else { - Table *t = luaH_new(L, 0, 0); - int *lineinfo = f->l.p->lineinfo; int i; + int *lineinfo = f->l.p->lineinfo; + Table *t = luaH_new(L); + sethvalue(L, L->top, t); + incr_top(L); for (i=0; il.p->sizelineinfo; i++) setbvalue(luaH_setnum(L, t, lineinfo[i]), 1); - sethvalue(L, L->top, t); } - incr_top(L); } -- cgit v1.2.3-55-g6feb