** set GCdebt to a new value keeping the real number of allocated ** objects (GCtotalobjs - GCdebt) invariant and avoiding overflows in ** 'GCtotalobjs'. */
| 59 | ** 'GCtotalobjs'. |
| 60 | */ |
| 61 | void luaE_setdebt (global_State *g, l_mem debt) { |
| 62 | l_mem tb = gettotalbytes(g); |
| 63 | lua_assert(tb > 0); |
| 64 | if (debt > MAX_LMEM - tb) |
| 65 | debt = MAX_LMEM - tb; /* will make GCtotalbytes == MAX_LMEM */ |
| 66 | g->GCtotalbytes = tb + debt; |
| 67 | g->GCdebt = debt; |
| 68 | } |
| 69 | |
| 70 | |
| 71 | CallInfo *luaE_extendCI (lua_State *L) { |