Changed signal of GC debt

Positive debts seems more natural then negative ones.
This commit is contained in:
Roberto Ierusalimschy
2022-12-13 15:45:57 -03:00
parent 40565b4a08
commit 5d8b5b9290
6 changed files with 22 additions and 25 deletions

4
lgc.h
View File

@@ -175,13 +175,13 @@
/*
** Does one step of collection when debt becomes positive. 'pre'/'pos'
** Does one step of collection when debt becomes zero. 'pre'/'pos'
** allows some adjustments to be done only when needed. macro
** 'condchangemem' is used only for heavy tests (forcing a full
** GC cycle on every opportunity)
*/
#define luaC_condGC(L,pre,pos) \
{ if (G(L)->GCdebt > 0) { pre; luaC_step(L); pos;}; \
{ if (G(L)->GCdebt <= 0) { pre; luaC_step(L); pos;}; \
condchangemem(L,pre,pos); }
/* more often than not, 'pre'/'pos' are empty */