Always grow aux ref stack considering the reserve

This commit is contained in:
Alex Orlenko
2025-07-15 16:32:22 +01:00
parent 00328b0b64
commit 459edb6816
+1 -1
View File
@@ -270,7 +270,7 @@ impl ExtraData {
// Try to grow max stack size
if self.ref_stack_top >= self.ref_stack_size {
let mut inc = self.ref_stack_size; // Try to double stack size
while inc > 0 && ffi::lua_checkstack(self.ref_thread, inc) == 0 {
while inc > 0 && ffi::lua_checkstack(self.ref_thread, inc + REF_STACK_RESERVE) == 0 {
inc /= 2;
}
if inc == 0 {