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.
This commit is contained in:
14
luaconf.h
14
luaconf.h
@@ -763,20 +763,6 @@
|
||||
** =====================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ LUAI_MAXSTACK limits the size of the Lua stack.
|
||||
** CHANGE it if you need a different limit. This limit is arbitrary;
|
||||
** its only purpose is to stop Lua from consuming unlimited stack
|
||||
** space and to reserve some numbers for pseudo-indices.
|
||||
** (It must fit into max(int)/2.)
|
||||
*/
|
||||
#if 1000000 < (INT_MAX / 2)
|
||||
#define LUAI_MAXSTACK 1000000
|
||||
#else
|
||||
#define LUAI_MAXSTACK (INT_MAX / 2u)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ LUA_EXTRASPACE defines the size of a raw memory area associated with
|
||||
** a Lua state with very fast access.
|
||||
|
||||
Reference in New Issue
Block a user