** set GCdebt to a new value keeping the value (totalbytes + GCdebt) ** invariant (and avoiding underflows in 'totalbytes') */
| 99 | ** invariant (and avoiding underflows in 'totalbytes') |
| 100 | */ |
| 101 | void luaE_setdebt(global_State *g, l_mem debt) { |
| 102 | l_mem tb = gettotalbytes(g); |
| 103 | lua_assert(tb > 0); |
| 104 | if (debt < tb - MAX_LMEM) |
| 105 | debt = tb - MAX_LMEM; /* will make 'totalbytes == MAX_LMEM' */ |
| 106 | g->totalbytes = tb - debt; |
| 107 | g->GCdebt = debt; |
| 108 | } |
| 109 | |
| 110 | |
| 111 | CallInfo *luaE_extendCI(lua_State *L) { |