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

View File

@@ -408,7 +408,7 @@ static void checktable (global_State *g, Table *h) {
for (n = gnode(h, 0); n < limit; n++) {
if (!isempty(gval(n))) {
TValue k;
getnodekey(g->mainthread, &k, n);
getnodekey(mainthread(g), &k, n);
assert(!keyisnil(n));
checkvalref(g, hgc, &k);
checkvalref(g, hgc, gval(n));
@@ -672,7 +672,7 @@ int lua_checkmemory (lua_State *L) {
l_mem totalin; /* total of objects that are in gray lists */
l_mem totalshould; /* total of objects that should be in gray lists */
if (keepinvariant(g)) {
assert(!iswhite(g->mainthread));
assert(!iswhite(mainthread(g)));
assert(!iswhite(gcvalue(&g->l_registry)));
}
assert(!isdead(g, gcvalue(&g->l_registry)));