lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I compiled with your switches (cl /O2 /W3) but as an EXE (not DLL) and with VS2013 (Win7-64) and I get this:

c:\temp>lua54.exe cstack.lua
testing C-stack overflow detection
testing simple recursion:
2164            final count:    2165
testing stack overflow in message handling
2413            final count:    2414
testing recursion inside pattern matching
testing stack-overflow in recursive 'gsub'
181             final count:    181
testing stack-overflow in recursive 'gsub' with metatables
272             final count:    272
OK

and it also passes all the tests when run with: lua54.exe -E -e"_U=true" all.lua

So, the switch /O2 makes a difference!

-----Original Message----- From: Roberto Ierusalimschy
Sent: Monday, June 03, 2019 4:44 PM
To: Lua mailing list
Subject: Re: Lua 5.4 tests?

[...]

Assuming the cstack.lua tests are valid also for 5.3.5, my guess from the
above results is that it's not my system or compiler configurations but
something in 5.4 is causing this dramatic reduction in maximum recursion.
But, that's for you to decide.

As already explained, there are strong reasons for the difference
between Lua 5.3 and 5.4. However, I tested Lua 5.4 in a smaller
Windows 7 (32 bits, 512 MB), with VS 2010; it passed all tests with
that limit of 2200. So, my concern is why your system or compiler
configuration in Windows 7 needs a limit which is less than 4x
mine. (Even assuming that they did not correct the default stack size to
compensate for 64-bit words, that could explain a difference of 2x, not
4x.)

So, either the code from VS 2013 uses much more stack than VS 2010, or
there is some other difference. My code was compiled with command lines,
roughly this:

 E:\> cl /O2 /W3 /c /DLUA_BUILD_AS_DLL l*.c
 E:\> link /DLL /out:lua54.dll l*.obj


For reference, in my Linux machine that limit could be 10x larger
(22000) without problems.

-- Roberto