aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lgc.c b/lgc.c
index aa6921bc..6562c928 100644
--- a/lgc.c
+++ b/lgc.c
@@ -794,10 +794,11 @@ static GCObject **sweeptolive (lua_State *L, GCObject **p) {
794*/ 794*/
795static void checkSizes (lua_State *L, global_State *g) { 795static 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