There's a way to attach a pointer (possibly pointing to structure of
several things you will actually use) to lua_State
by passing it to lua_newstate () or by setting it with lua_setallocf ().
Actually I think the correct method for this is to set LUAI_EXTRASPACE in luaconf.h