mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-10 22:00:54 +01:00
Make pseudo-indices relative to LUAI_MAXCSTACK (#766)
This is useful in particular if redefine `LUAI_MAXCSTACK` to a higher value than the current one (8000). Ie. passing `-D LUAI_MAXCSTACK=1000000` would not work as overlaps with `LUA_REGISTRYINDEX` and below.
This commit is contained in:
parent
4e6ae32625
commit
e9d4ee7a33
1 changed files with 3 additions and 3 deletions
|
@ -17,9 +17,9 @@
|
||||||
/*
|
/*
|
||||||
** pseudo-indices
|
** pseudo-indices
|
||||||
*/
|
*/
|
||||||
#define LUA_REGISTRYINDEX (-10000)
|
#define LUA_REGISTRYINDEX (-LUAI_MAXCSTACK - 2000)
|
||||||
#define LUA_ENVIRONINDEX (-10001)
|
#define LUA_ENVIRONINDEX (-LUAI_MAXCSTACK - 2001)
|
||||||
#define LUA_GLOBALSINDEX (-10002)
|
#define LUA_GLOBALSINDEX (-LUAI_MAXCSTACK - 2002)
|
||||||
#define lua_upvalueindex(i) (LUA_GLOBALSINDEX - (i))
|
#define lua_upvalueindex(i) (LUA_GLOBALSINDEX - (i))
|
||||||
#define lua_ispseudo(i) ((i) <= LUA_REGISTRYINDEX)
|
#define lua_ispseudo(i) ((i) <= LUA_REGISTRYINDEX)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue