Where are Lua's “global” local values stored?
Where are Lua's “global” local values stored? I need to call a Lua function from C and as long the function is global I can find it in the global table, but if it is declared local, how can I push the address on the stack to call it? function MyGlobal() print("Global") end local function MyLocalGlobal() print("Local") end Calling MyGlobal() from C isn't a problem it works fine. I lookup the function in the global table. MyGlobal() But how do I call MyLocalGlobal() from C? It isn't in the global table, but where is it and how can I push the address? MyLocalGlobal() I'm using Lua 5.3.4. Probably, MyLocalGlobal does not exist anymore. Local functions are subject to garbage collection after control exits their lexical scope. – Egor Skriptunoff Jun 29 at 7:07 MyLocalGlobal ...