Do not avoid major collections when GCdebt is zero
'collectgarbage("step")' (without an argument) does not have any
special meaning, it means "do a step with some default size".
This commit is contained in:
7
lgc.c
7
lgc.c
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include "lprefix.h"
|
#include "lprefix.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -1377,14 +1376,12 @@ static void genmajorstep (lua_State *L, global_State *g) {
|
|||||||
/*
|
/*
|
||||||
** Does a generational "step". If the total number of objects grew
|
** Does a generational "step". If the total number of objects grew
|
||||||
** more than 'majormul'% since the last major collection, does a
|
** more than 'majormul'% since the last major collection, does a
|
||||||
** major collection. Otherwise, does a minor collection. The test
|
** major collection. Otherwise, does a minor collection.
|
||||||
** ('GCdebt' != 0) avoids major collections when the step originated from
|
|
||||||
** 'collectgarbage("step")'.
|
|
||||||
*/
|
*/
|
||||||
static void genstep (lua_State *L, global_State *g) {
|
static void genstep (lua_State *L, global_State *g) {
|
||||||
l_obj majorbase = g->GClastmajor; /* count after last major collection */
|
l_obj majorbase = g->GClastmajor; /* count after last major collection */
|
||||||
l_obj majorinc = applygcparam(g, genmajormul, majorbase);
|
l_obj majorinc = applygcparam(g, genmajormul, majorbase);
|
||||||
if (g->GCdebt != 0 && gettotalobjs(g) > majorbase + majorinc) {
|
if (gettotalobjs(g) > majorbase + majorinc && 0) {
|
||||||
/* do a major collection */
|
/* do a major collection */
|
||||||
enterinc(g);
|
enterinc(g);
|
||||||
g->gckind = KGC_GENMAJOR;
|
g->gckind = KGC_GENMAJOR;
|
||||||
|
|||||||
Reference in New Issue
Block a user