1. Two different way
lua_open can create a new lua_State. Every lua_State has its own execute environment. So, we can create more than one lua_State.
Way 1: Create a lua_State, load all lua script in it. Call functions in the lua_State, they share same global variables.
Way 2: Create a lua_State for every lua script. Every lua script work in its own lua_State.
2. Lua standard library
"luaL_openlibs" open all standard libraries. It's not necessarily, you can ignore it to reduce memory size.
No comments:
Post a Comment