// Main thread combines a thread state and the global state typedef struct LG { lua_State l; global_State g; } LG; lua_State: &{Value; int tt} stack, stack_last, base, top GCObject* next byte tt # type == THREAD initializing a lua_State (lua_newstate) allocate space (including for globals) next = NULL stack = NULL Lua's stack vs globals: https://lucasklassmann.com/blog/2019-02-02-how-to-embeddeding-lua-in-c/#exposing-a-simple-variable