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

Function luaE_setdebt

depends/lua/src/lstate.c:98–105  ·  view source on GitHub ↗

** set GCdebt to a new value keeping the value (totalbytes + GCdebt) ** invariant (and avoiding underflows in 'totalbytes') */

Source from the content-addressed store, hash-verified

96** invariant (and avoiding underflows in 'totalbytes')
97*/
98void luaE_setdebt (global_State *g, l_mem debt) {
99 l_mem tb = gettotalbytes(g);
100 lua_assert(tb > 0);
101 if (debt < tb - MAX_LMEM)
102 debt = tb - MAX_LMEM; /* will make 'totalbytes == MAX_LMEM' */
103 g->totalbytes = tb - debt;
104 g->GCdebt = debt;
105}
106
107
108CallInfo *luaE_extendCI (lua_State *L) {

Callers 3

lua_gcFunction · 0.85
setpauseFunction · 0.85
luaC_stepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected