diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-07-01 10:57:02 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-07-01 10:57:02 -0300 |
commit | 59a1adf194efe43741c2bb2005d93d8320a19d14 (patch) | |
tree | 4b65f62e0b6fa8701608c776b27b65e283dc9d0b /luaconf.h | |
parent | cfce6f4b20afe85ede2182b3df3ab2bfcdb0e692 (diff) | |
download | lua-59a1adf194efe43741c2bb2005d93d8320a19d14.tar.gz lua-59a1adf194efe43741c2bb2005d93d8320a19d14.tar.bz2 lua-59a1adf194efe43741c2bb2005d93d8320a19d14.zip |
LUAI_MAXSTACK defined privately
LUAI_MAXSTACK is limited to INT_MAX/2, so can use INT_MAX/2 to define
pseudo-indices (LUA_REGISTRYINDEX) in 'lua.h'. A change in the maximum
stack size does not need to change the Lua-C ABI.
Diffstat (limited to 'luaconf.h')
-rw-r--r-- | luaconf.h | 14 |
1 files changed, 0 insertions, 14 deletions
@@ -764,20 +764,6 @@ | |||
764 | */ | 764 | */ |
765 | 765 | ||
766 | /* | 766 | /* |
767 | @@ LUAI_MAXSTACK limits the size of the Lua stack. | ||
768 | ** CHANGE it if you need a different limit. This limit is arbitrary; | ||
769 | ** its only purpose is to stop Lua from consuming unlimited stack | ||
770 | ** space and to reserve some numbers for pseudo-indices. | ||
771 | ** (It must fit into max(int)/2.) | ||
772 | */ | ||
773 | #if 1000000 < (INT_MAX / 2) | ||
774 | #define LUAI_MAXSTACK 1000000 | ||
775 | #else | ||
776 | #define LUAI_MAXSTACK (INT_MAX / 2u) | ||
777 | #endif | ||
778 | |||
779 | |||
780 | /* | ||
781 | @@ LUA_EXTRASPACE defines the size of a raw memory area associated with | 767 | @@ LUA_EXTRASPACE defines the size of a raw memory area associated with |
782 | ** a Lua state with very fast access. | 768 | ** a Lua state with very fast access. |
783 | ** CHANGE it if you need a different size. | 769 | ** CHANGE it if you need a different size. |