lua-users home
lua-l archive

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


> I have this default settings in my Windows CE platforms for the Linker:
> 
> - Stack Reserve Size: 65536
> - Stack Commit Size: 4096
> 
> The following tests fail:
> -- pm.lua:
> rev(rev(x) with more then 30 characters in x
> --
> 
> -- coroutine.lua:
> -- infinite recursion of coroutines
> [...]
> 
> -- errors.lua:
> -- tests for errors in coroutines
> 
> [...]
> [...]
> -- testing syntax limits

The first error demands too much C stack without reason; I will
change that test. All the others are testing the Lua mechanism
to avoid real C-stack overflow. Their failure are meaningful.

Because your system has limited stack, you should define the following
macros when compiling Lua:

- LUAI_MAXCCALLS: It controls how much C stack Lua assumes it can
use before raising an error. Its default value is 200, but for your
system I guess something like 30~40 should be appropriate. (You have
to test for a good value: as large as possible to still pass those
tests.)

- LUAL_BUFFERSIZE: The size of some buffers used by Lua. It is defined
to be BUFSIZ, but it can be something smaller (even 128 would be OK),
so that several functions in Lua use less stack space. (You should not
define this macro, but change its definition in 'luaconf.h'.)

-- Roberto