Clear interface between references and predefines

The reference system has a defined way to add initial values to the
table where it operates.
This commit is contained in:
Roberto Ierusalimschy
2024-01-15 11:31:49 -03:00
parent 8eb0abc9db
commit 17e0c29d9b
7 changed files with 92 additions and 43 deletions

5
lua.h
View File

@@ -80,9 +80,10 @@ typedef struct lua_State lua_State;
/* predefined values in the registry */
#define LUA_RIDX_MAINTHREAD 1
/* index 1 is reserved for the reference mechanism */
#define LUA_RIDX_GLOBALS 2
#define LUA_RIDX_LAST LUA_RIDX_GLOBALS
#define LUA_RIDX_MAINTHREAD 3
#define LUA_RIDX_LAST 3
/* type of numbers in Lua */