get rid of userstate hooks
This commit is contained in:
parent
67e4fb8c8e
commit
4a28aace9a
|
@ -145,7 +145,6 @@ LUA_API lua_State *lua_newthread (lua_State *L) {
|
||||||
setthvalue(L, L->top, L1);
|
setthvalue(L, L->top, L1);
|
||||||
api_incr_top(L);
|
api_incr_top(L);
|
||||||
lua_unlock(L);
|
lua_unlock(L);
|
||||||
luai_userstatethread(L, L1);
|
|
||||||
return L1;
|
return L1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -422,7 +422,6 @@ LUA_API int lua_resume (lua_State *L, int nargs) {
|
||||||
return resume_error(L, "cannot resume non-suspended coroutine");
|
return resume_error(L, "cannot resume non-suspended coroutine");
|
||||||
if (L->nCcalls >= LUAI_MAXCCALLS)
|
if (L->nCcalls >= LUAI_MAXCCALLS)
|
||||||
return resume_error(L, "C stack overflow");
|
return resume_error(L, "C stack overflow");
|
||||||
luai_userstateresume(L, nargs);
|
|
||||||
lua_assert(L->errfunc == 0);
|
lua_assert(L->errfunc == 0);
|
||||||
L->baseCcalls = ++L->nCcalls;
|
L->baseCcalls = ++L->nCcalls;
|
||||||
status = luaD_rawrunprotected(L, resume, L->top - nargs);
|
status = luaD_rawrunprotected(L, resume, L->top - nargs);
|
||||||
|
@ -442,7 +441,6 @@ LUA_API int lua_resume (lua_State *L, int nargs) {
|
||||||
|
|
||||||
|
|
||||||
LUA_API int lua_yield (lua_State *L, int nresults) {
|
LUA_API int lua_yield (lua_State *L, int nresults) {
|
||||||
luai_userstateyield(L, nresults);
|
|
||||||
lua_lock(L);
|
lua_lock(L);
|
||||||
if (L->nCcalls > L->baseCcalls)
|
if (L->nCcalls > L->baseCcalls)
|
||||||
luaG_runerror(L, "attempt to yield across metamethod/C-call boundary");
|
luaG_runerror(L, "attempt to yield across metamethod/C-call boundary");
|
||||||
|
|
|
@ -129,7 +129,6 @@ lua_State *luaE_newthread (lua_State *L) {
|
||||||
void luaE_freethread (lua_State *L, lua_State *L1) {
|
void luaE_freethread (lua_State *L, lua_State *L1) {
|
||||||
luaF_close(L1, L1->stack); /* close all upvalues for this thread */
|
luaF_close(L1, L1->stack); /* close all upvalues for this thread */
|
||||||
lua_assert(L1->openupval == NULL);
|
lua_assert(L1->openupval == NULL);
|
||||||
luai_userstatefree(L1);
|
|
||||||
freestack(L, L1);
|
freestack(L, L1);
|
||||||
luaM_freemem(L, cast(lu_byte*, L1), sizeof(lua_State));
|
luaM_freemem(L, cast(lu_byte*, L1), sizeof(lua_State));
|
||||||
}
|
}
|
||||||
|
@ -179,8 +178,6 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
|
||||||
close_state(L);
|
close_state(L);
|
||||||
L = NULL;
|
L = NULL;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
luai_userstateopen(L);
|
|
||||||
return L;
|
return L;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +200,6 @@ LUA_API void lua_close (lua_State *L) {
|
||||||
L->nCcalls = L->baseCcalls = 0;
|
L->nCcalls = L->baseCcalls = 0;
|
||||||
} while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0);
|
} while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0);
|
||||||
lua_assert(G(L)->tmudata == NULL);
|
lua_assert(G(L)->tmudata == NULL);
|
||||||
luai_userstateclose(L);
|
|
||||||
close_state(L);
|
close_state(L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -664,19 +664,6 @@ union luai_Cast { double l_d; long l_l; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
@@ luai_userstate* allow user-specific actions on threads.
|
|
||||||
** CHANGE them if you defined LUAI_EXTRASPACE and need to do something
|
|
||||||
** extra when a thread is created/deleted/resumed/yielded.
|
|
||||||
*/
|
|
||||||
#define luai_userstateopen(L) ((void)L)
|
|
||||||
#define luai_userstateclose(L) ((void)L)
|
|
||||||
#define luai_userstatethread(L,L1) ((void)L)
|
|
||||||
#define luai_userstatefree(L) ((void)L)
|
|
||||||
#define luai_userstateresume(L,n) ((void)L)
|
|
||||||
#define luai_userstateyield(L,n) ((void)L)
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ LUA_INTFRMLEN is the length modifier for integer conversions
|
@@ LUA_INTFRMLEN is the length modifier for integer conversions
|
||||||
@* in 'string.format'.
|
@* in 'string.format'.
|
||||||
|
|
Loading…
Reference in New Issue