From f4123b2fc2a662c08e3d7edc721241c251a22c4b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 31 Mar 2025 13:44:41 -0300 Subject: Growth factor of 1.5 for stack and lexical buffer --- ldo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ldo.c') diff --git a/ldo.c b/ldo.c index b0d37bf7..6824a21f 100644 --- a/ldo.c +++ b/ldo.c @@ -319,7 +319,7 @@ int luaD_growstack (lua_State *L, int n, int raiseerror) { return 0; /* if not 'raiseerror', just signal it */ } else if (n < MAXSTACK) { /* avoids arithmetic overflows */ - int newsize = 2 * size; /* tentative new size */ + int newsize = size + (size >> 1); /* tentative new size (size * 1.5) */ int needed = cast_int(L->top.p - L->stack.p) + n; if (newsize > MAXSTACK) /* cannot cross the limit */ newsize = MAXSTACK; -- cgit v1.2.3-55-g6feb