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