diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-26 09:45:51 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-26 09:45:51 -0200 |
commit | bce6572579a7e6c7a96895d9280396b3b33b8f3f (patch) | |
tree | a937d0366ae9d9e37e6320b347ec463f337ceb1b /ldo.c | |
parent | a53d9b66ca6247818acaf41e28cdf123082a272b (diff) | |
download | lua-bce6572579a7e6c7a96895d9280396b3b33b8f3f.tar.gz lua-bce6572579a7e6c7a96895d9280396b3b33b8f3f.tar.bz2 lua-bce6572579a7e6c7a96895d9280396b3b33b8f3f.zip |
new macros + new names to facilitate compilation of threaded version
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 1.115 2001/01/19 13:20:30 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.116 2001/01/24 15:45:33 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -94,9 +94,9 @@ static void dohook (lua_State *L, lua_Debug *ar, lua_Hook hook) { | |||
94 | StkId old_top = L->Cbase = L->top; | 94 | StkId old_top = L->Cbase = L->top; |
95 | luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ | 95 | luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ |
96 | L->allowhooks = 0; /* cannot call hooks inside a hook */ | 96 | L->allowhooks = 0; /* cannot call hooks inside a hook */ |
97 | LUA_EXIT; | 97 | LUA_UNLOCK; |
98 | (*hook)(L, ar); | 98 | (*hook)(L, ar); |
99 | LUA_ENTRY; | 99 | LUA_LOCK; |
100 | lua_assert(L->allowhooks == 0); | 100 | lua_assert(L->allowhooks == 0); |
101 | L->allowhooks = 1; | 101 | L->allowhooks = 1; |
102 | L->top = old_top; | 102 | L->top = old_top; |
@@ -135,9 +135,9 @@ static StkId callCclosure (lua_State *L, const struct Closure *cl, StkId base) { | |||
135 | luaD_checkstack(L, nup+LUA_MINSTACK); /* ensure minimum stack size */ | 135 | luaD_checkstack(L, nup+LUA_MINSTACK); /* ensure minimum stack size */ |
136 | for (n=0; n<nup; n++) /* copy upvalues as extra arguments */ | 136 | for (n=0; n<nup; n++) /* copy upvalues as extra arguments */ |
137 | setobj(L->top++, &cl->upvalue[n]); | 137 | setobj(L->top++, &cl->upvalue[n]); |
138 | LUA_EXIT; | 138 | LUA_UNLOCK; |
139 | n = (*cl->f.c)(L); /* do the actual call */ | 139 | n = (*cl->f.c)(L); /* do the actual call */ |
140 | LUA_ENTRY; | 140 | LUA_LOCK; |
141 | L->Cbase = old_Cbase; /* restore old C base */ | 141 | L->Cbase = old_Cbase; /* restore old C base */ |
142 | return L->top - n; /* return index of first result */ | 142 | return L->top - n; /* return index of first result */ |
143 | } | 143 | } |
@@ -219,13 +219,13 @@ LUA_API int lua_call (lua_State *L, int nargs, int nresults) { | |||
219 | StkId func; | 219 | StkId func; |
220 | struct CallS c; | 220 | struct CallS c; |
221 | int status; | 221 | int status; |
222 | LUA_ENTRY; | 222 | LUA_LOCK; |
223 | func = L->top - (nargs+1); /* function to be called */ | 223 | func = L->top - (nargs+1); /* function to be called */ |
224 | c.func = func; c.nresults = nresults; | 224 | c.func = func; c.nresults = nresults; |
225 | status = luaD_runprotected(L, f_call, &c); | 225 | status = luaD_runprotected(L, f_call, &c); |
226 | if (status != 0) /* an error occurred? */ | 226 | if (status != 0) /* an error occurred? */ |
227 | L->top = func; /* remove parameters from the stack */ | 227 | L->top = func; /* remove parameters from the stack */ |
228 | LUA_EXIT; | 228 | LUA_UNLOCK; |
229 | return status; | 229 | return status; |
230 | } | 230 | } |
231 | 231 | ||
@@ -249,7 +249,7 @@ static int protectedparser (lua_State *L, ZIO *z, int bin) { | |||
249 | struct ParserS p; | 249 | struct ParserS p; |
250 | mem_int old_blocks; | 250 | mem_int old_blocks; |
251 | int status; | 251 | int status; |
252 | LUA_ENTRY; | 252 | LUA_LOCK; |
253 | p.z = z; p.bin = bin; | 253 | p.z = z; p.bin = bin; |
254 | luaC_checkGC(L); | 254 | luaC_checkGC(L); |
255 | old_blocks = G(L)->nblocks; | 255 | old_blocks = G(L)->nblocks; |
@@ -261,7 +261,7 @@ static int protectedparser (lua_State *L, ZIO *z, int bin) { | |||
261 | } | 261 | } |
262 | else if (status == LUA_ERRRUN) /* an error occurred: correct error code */ | 262 | else if (status == LUA_ERRRUN) /* an error occurred: correct error code */ |
263 | status = LUA_ERRSYNTAX; | 263 | status = LUA_ERRSYNTAX; |
264 | LUA_EXIT; | 264 | LUA_UNLOCK; |
265 | return status; | 265 | return status; |
266 | } | 266 | } |
267 | 267 | ||