MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaM_malloc_

Function luaM_malloc_

extlibs/lua/src/lmem.c:188–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186
187
188void *luaM_malloc_ (lua_State *L, size_t size, int tag) {
189 if (size == 0)
190 return NULL; /* that's all */
191 else {
192 global_State *g = G(L);
193 void *newblock = firsttry(g, NULL, tag, size);
194 if (unlikely(newblock == NULL)) {
195 newblock = tryagain(L, NULL, tag, size);
196 if (newblock == NULL)
197 luaM_error(L);
198 }
199 g->GCdebt += size;
200 return newblock;
201 }
202}

Callers

nothing calls this directly

Calls 2

firsttryFunction · 0.85
tryagainFunction · 0.85

Tested by

no test coverage detected