MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / getdebt

Function getdebt

src/Chain/libraries/glua/lgc.cpp:1119–1128  ·  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

1117** and overflows)
1118*/
1119static l_mem getdebt(global_State *g) {
1120 l_mem debt = g->GCdebt;
1121 int stepmul = g->gcstepmul;
1122 if (debt <= 0) return 0; /* minimal debt */
1123 else {
1124 debt = (debt / STEPMULADJ) + 1;
1125 debt = (debt < MAX_LMEM / stepmul) ? debt * stepmul : MAX_LMEM;
1126 return debt;
1127 }
1128}
1129
1130/*
1131** 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