MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaM_malloc_

Function luaM_malloc_

3rd/lua-5.4.3/src/lmem.c:187–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

firsttryFunction · 0.85
tryagainFunction · 0.85

Tested by

no test coverage detected