diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-03-31 13:44:41 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-03-31 13:44:41 -0300 |
commit | f4123b2fc2a662c08e3d7edc721241c251a22c4b (patch) | |
tree | f856da11d3134e1755bdb11192394dfd5c3595cd /ldo.c | |
parent | 37a1b72706b6e55e60b8d73bcbe269921976825e (diff) | |
download | lua-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |