MCPcopy Create free account
hub / github.com/DFHack/dfhack / checkSizes

Function checkSizes

depends/lua/src/lgc.c:778–785  ·  view source on GitHub ↗

** If possible, shrink string table */

Source from the content-addressed store, hash-verified

776** If possible, shrink string table
777*/
778static void checkSizes (lua_State *L, global_State *g) {
779 if (g->gckind != KGC_EMERGENCY) {
780 l_mem olddebt = g->GCdebt;
781 if (g->strt.nuse < g->strt.size / 4) /* string table too big? */
782 luaS_resize(L, g->strt.size / 2); /* shrink it a little */
783 g->GCestimate += g->GCdebt - olddebt; /* update estimate */
784 }
785}
786
787
788static GCObject *udata2finalize (global_State *g) {

Callers 1

singlestepFunction · 0.85

Calls 1

luaS_resizeFunction · 0.85

Tested by

no test coverage detected