This commit is contained in:
Miku AuahDark
2022-08-25 18:33:56 +08:00
parent 27276a031d
commit 65e6adcbd1
69 changed files with 992 additions and 553 deletions
+3
View File
@@ -700,9 +700,12 @@ static size_t gc_onestep(lua_State *L)
}
case GCSfinalize:
if (gcref(g->gc.mmudata) != NULL) {
GCSize old = g->gc.total;
if (tvref(g->jit_base)) /* Don't call finalizers on trace. */
return LJ_MAX_MEM;
gc_finalize(L); /* Finalize one userdata object. */
if (old >= g->gc.total && g->gc.estimate > old - g->gc.total)
g->gc.estimate -= old - g->gc.total;
if (g->gc.estimate > GCFINALIZECOST)
g->gc.estimate -= GCFINALIZECOST;
return GCFINALIZECOST;