get rid of userstate hooks

This commit is contained in:
Kartik K. Agaram 2021-10-24 09:52:07 -07:00
parent 67e4fb8c8e
commit 4a28aace9a
5 changed files with 0 additions and 21 deletions

View File

@ -145,7 +145,6 @@ LUA_API lua_State *lua_newthread (lua_State *L) {
setthvalue(L, L->top, L1);
api_incr_top(L);
lua_unlock(L);
luai_userstatethread(L, L1);
return L1;
}

View File

@ -422,7 +422,6 @@ LUA_API int lua_resume (lua_State *L, int nargs) {
return resume_error(L, "cannot resume non-suspended coroutine");
if (L->nCcalls >= LUAI_MAXCCALLS)
return resume_error(L, "C stack overflow");
luai_userstateresume(L, nargs);
lua_assert(L->errfunc == 0);
L->baseCcalls = ++L->nCcalls;
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) {
luai_userstateyield(L, nresults);
lua_lock(L);
if (L->nCcalls > L->baseCcalls)
luaG_runerror(L, "attempt to yield across metamethod/C-call boundary");

View File

@ -129,7 +129,6 @@ lua_State *luaE_newthread (lua_State *L) {
void luaE_freethread (lua_State *L, lua_State *L1) {
luaF_close(L1, L1->stack); /* close all upvalues for this thread */
lua_assert(L1->openupval == NULL);
luai_userstatefree(L1);
freestack(L, L1);
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);
L = NULL;
}
else
luai_userstateopen(L);
return L;
}
@ -203,7 +200,6 @@ LUA_API void lua_close (lua_State *L) {
L->nCcalls = L->baseCcalls = 0;
} while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0);
lua_assert(G(L)->tmudata == NULL);
luai_userstateclose(L);
close_state(L);
}

View File

@ -664,19 +664,6 @@ union luai_Cast { double l_d; long l_l; };
#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
@* in 'string.format'.

View File

@ -8,6 +8,5 @@ lua_State:
&{Value; int tt} stack, stack_last, base, top
== todo stack
eradicate LUAI_EXTRASPACE
lua_newstate
lua_State's stack