MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaE_setdebt

Function luaE_setdebt

libraries/AP_Scripting/lua/src/lstate.c:106–113  ·  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

104** invariant (and avoiding underflows in 'totalbytes')
105*/
106void luaE_setdebt (global_State *g, l_mem debt) {
107 l_mem tb = gettotalbytes(g);
108 lua_assert(tb > 0);
109 if (debt < tb - MAX_LMEM)
110 debt = tb - MAX_LMEM; /* will make 'totalbytes == MAX_LMEM' */
111 g->totalbytes = tb - debt;
112 g->GCdebt = debt;
113}
114
115
116CallInfo *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