** set GCdebt to a new value keeping the value (totalbytes + GCdebt) ** invariant (and avoiding underflows in 'totalbytes') */
| 87 | ** invariant (and avoiding underflows in 'totalbytes') |
| 88 | */ |
| 89 | void luaE_setdebt (global_State *g, l_mem debt) { |
| 90 | l_mem tb = gettotalbytes(g); |
| 91 | lua_assert(tb > 0); |
| 92 | if (debt < tb - MAX_LMEM) |
| 93 | debt = tb - MAX_LMEM; /* will make 'totalbytes == MAX_LMEM' */ |
| 94 | g->totalbytes = tb - debt; |
| 95 | g->GCdebt = debt; |
| 96 | } |
| 97 | |
| 98 | |
| 99 | LUA_API int lua_setcstacklimit (lua_State *L, unsigned int limit) { |
no outgoing calls
no test coverage detected