** In case of allocation fail, this function will do an emergency ** collection to free some memory and then try the allocation again. */
| 160 | ** collection to free some memory and then try the allocation again. |
| 161 | */ |
| 162 | static void *tryagain (lua_State *L, void *block, |
| 163 | size_t osize, size_t nsize) { |
| 164 | global_State *g = G(L); |
| 165 | if (cantryagain(g)) { |
| 166 | luaC_fullgc(L, 1); /* try to free some memory... */ |
| 167 | return callfrealloc(g, block, osize, nsize); /* try again */ |
| 168 | } |
| 169 | else return NULL; /* cannot run an emergency collection */ |
| 170 | } |
| 171 | |
| 172 | |
| 173 | /* |
no test coverage detected