new macros + new names to facilitate compilation of threaded version

This commit is contained in:
Roberto Ierusalimschy
2001-01-26 09:45:51 -02:00
parent a53d9b66ca
commit bce6572579
9 changed files with 190 additions and 176 deletions

18
ldo.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: ldo.c,v 1.115 2001/01/19 13:20:30 roberto Exp roberto $
** $Id: ldo.c,v 1.116 2001/01/24 15:45:33 roberto Exp roberto $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
@@ -94,9 +94,9 @@ static void dohook (lua_State *L, lua_Debug *ar, lua_Hook hook) {
StkId old_top = L->Cbase = L->top;
luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */
L->allowhooks = 0; /* cannot call hooks inside a hook */
LUA_EXIT;
LUA_UNLOCK;
(*hook)(L, ar);
LUA_ENTRY;
LUA_LOCK;
lua_assert(L->allowhooks == 0);
L->allowhooks = 1;
L->top = old_top;
@@ -135,9 +135,9 @@ static StkId callCclosure (lua_State *L, const struct Closure *cl, StkId base) {
luaD_checkstack(L, nup+LUA_MINSTACK); /* ensure minimum stack size */
for (n=0; n<nup; n++) /* copy upvalues as extra arguments */
setobj(L->top++, &cl->upvalue[n]);
LUA_EXIT;
LUA_UNLOCK;
n = (*cl->f.c)(L); /* do the actual call */
LUA_ENTRY;
LUA_LOCK;
L->Cbase = old_Cbase; /* restore old C base */
return L->top - n; /* return index of first result */
}
@@ -219,13 +219,13 @@ LUA_API int lua_call (lua_State *L, int nargs, int nresults) {
StkId func;
struct CallS c;
int status;
LUA_ENTRY;
LUA_LOCK;
func = L->top - (nargs+1); /* function to be called */
c.func = func; c.nresults = nresults;
status = luaD_runprotected(L, f_call, &c);
if (status != 0) /* an error occurred? */
L->top = func; /* remove parameters from the stack */
LUA_EXIT;
LUA_UNLOCK;
return status;
}
@@ -249,7 +249,7 @@ static int protectedparser (lua_State *L, ZIO *z, int bin) {
struct ParserS p;
mem_int old_blocks;
int status;
LUA_ENTRY;
LUA_LOCK;
p.z = z; p.bin = bin;
luaC_checkGC(L);
old_blocks = G(L)->nblocks;
@@ -261,7 +261,7 @@ static int protectedparser (lua_State *L, ZIO *z, int bin) {
}
else if (status == LUA_ERRRUN) /* an error occurred: correct error code */
status = LUA_ERRSYNTAX;
LUA_EXIT;
LUA_UNLOCK;
return status;
}