MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / tryagain

Function tryagain

lib/lua/src/lmem.c:162–170  ·  view source on GitHub ↗

** In case of allocation fail, this function will do an emergency ** collection to free some memory and then try the allocation again. */

Source from the content-addressed store, hash-verified

160** collection to free some memory and then try the allocation again.
161*/
162static 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/*

Callers 2

luaM_realloc_Function · 0.85
luaM_malloc_Function · 0.85

Calls 2

luaC_fullgcFunction · 0.85
GFunction · 0.50

Tested by

no test coverage detected