aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-03-31 13:44:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-03-31 13:44:41 -0300
commitf4123b2fc2a662c08e3d7edc721241c251a22c4b (patch)
treef856da11d3134e1755bdb11192394dfd5c3595cd /ldo.c
parent37a1b72706b6e55e60b8d73bcbe269921976825e (diff)
downloadlua-f4123b2fc2a662c08e3d7edc721241c251a22c4b.tar.gz
lua-f4123b2fc2a662c08e3d7edc721241c251a22c4b.tar.bz2
lua-f4123b2fc2a662c08e3d7edc721241c251a22c4b.zip
Growth factor of 1.5 for stack and lexical buffer
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c2
1 files changed, 1 insertions, 1 deletions
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) {
319 return 0; /* if not 'raiseerror', just signal it */ 319 return 0; /* if not 'raiseerror', just signal it */
320 } 320 }
321 else if (n < MAXSTACK) { /* avoids arithmetic overflows */ 321 else if (n < MAXSTACK) { /* avoids arithmetic overflows */
322 int newsize = 2 * size; /* tentative new size */ 322 int newsize = size + (size >> 1); /* tentative new size (size * 1.5) */
323 int needed = cast_int(L->top.p - L->stack.p) + n; 323 int needed = cast_int(L->top.p - L->stack.p) + n;
324 if (newsize > MAXSTACK) /* cannot cross the limit */ 324 if (newsize > MAXSTACK) /* cannot cross the limit */
325 newsize = MAXSTACK; 325 newsize = MAXSTACK;