MCPcopy Create free account
hub / github.com/DFHack/dfhack / getdebt

Function getdebt

depends/lua/src/lgc.c:1115–1124  ·  view source on GitHub ↗

** get GC debt and convert it from Kb to 'work units' (avoid zero debt ** and overflows) */

Source from the content-addressed store, hash-verified

1113** and overflows)
1114*/
1115static l_mem getdebt (global_State *g) {
1116 l_mem debt = g->GCdebt;
1117 int stepmul = g->gcstepmul;
1118 if (debt <= 0) return 0; /* minimal debt */
1119 else {
1120 debt = (debt / STEPMULADJ) + 1;
1121 debt = (debt < MAX_LMEM / stepmul) ? debt * stepmul : MAX_LMEM;
1122 return debt;
1123 }
1124}
1125
1126/*
1127** performs a basic GC step when collector is running

Callers 1

luaC_stepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected