diff options
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -794,10 +794,11 @@ static GCObject **sweeptolive (lua_State *L, GCObject **p) { | |||
794 | */ | 794 | */ |
795 | static void checkSizes (lua_State *L, global_State *g) { | 795 | static void checkSizes (lua_State *L, global_State *g) { |
796 | if (!g->gcemergency) { | 796 | if (!g->gcemergency) { |
797 | l_mem olddebt = g->GCdebt; | 797 | if (g->strt.nuse < g->strt.size / 4) { /* string table too big? */ |
798 | if (g->strt.nuse < g->strt.size / 4) /* string table too big? */ | 798 | l_mem olddebt = g->GCdebt; |
799 | luaS_resize(L, g->strt.size / 2); | 799 | luaS_resize(L, g->strt.size / 2); |
800 | g->GCestimate += g->GCdebt - olddebt; /* correct estimate */ | 800 | g->GCestimate += g->GCdebt - olddebt; /* correct estimate */ |
801 | } | ||
801 | } | 802 | } |
802 | } | 803 | } |
803 | 804 | ||