Main thread is a regular field of global_State

They were already allocated as a single block, so there is no need
for the global_State to point to its main thread.
This commit is contained in:
Roberto Ierusalimschy
2025-01-31 13:51:38 -03:00
parent d1e677c52b
commit fa1382b5cd
6 changed files with 65 additions and 75 deletions

2
lapi.c
View File

@@ -655,7 +655,7 @@ LUA_API int lua_pushthread (lua_State *L) {
setthvalue(L, s2v(L->top.p), L);
api_incr_top(L);
lua_unlock(L);
return (G(L)->mainthread == L);
return (mainthread(G(L)) == L);
}