MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / newbox

Function newbox

src/Chain/libraries/glua/lauxlib.cpp:485–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483
484
485static void *newbox(lua_State *L, size_t newsize) {
486 UBox *box = (UBox *)lua_newuserdata(L, sizeof(UBox));
487 box->box = nullptr;
488 box->bsize = 0;
489 if (luaL_newmetatable(L, "LUABOX")) { /* creating metatable? */
490 lua_pushcfunction(L, boxgc);
491 lua_setfield(L, -2, "__gc"); /* metatable.__gc = boxgc */
492 }
493 lua_setmetatable(L, -2);
494 return resizebox(L, -1, newsize);
495}
496
497
498/*

Callers 1

luaL_prepbuffsizeFunction · 0.85

Calls 5

lua_newuserdataFunction · 0.85
luaL_newmetatableFunction · 0.85
lua_setfieldFunction · 0.85
lua_setmetatableFunction · 0.85
resizeboxFunction · 0.85

Tested by

no test coverage detected