Detail (debugging aid)

When compiling with option HARDMEMTESTS, every creation of a new key
in a table forces an emergency GC.
This commit is contained in:
Roberto Ierusalimschy
2025-01-06 12:41:39 -03:00
parent 5894ca7b95
commit 1ec251e091
2 changed files with 6 additions and 4 deletions

View File

@@ -910,6 +910,8 @@ static void luaH_newkey (lua_State *L, Table *t, const TValue *key,
newcheckedkey(t, key, value); /* insert key in grown table */
}
luaC_barrierback(L, obj2gco(t), key);
/* for debugging only: any new key may force an emergency collection */
condchangemem(L, (void)0, (void)0, 1);
}
}