MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / createclibstable

Function createclibstable

ThirdParty/lua/lua/loadlib.c:752–759  ·  view source on GitHub ↗

** create table CLIBS to keep track of loaded C libraries, ** setting a finalizer to close all libraries when closing state. */

Source from the content-addressed store, hash-verified

750** setting a finalizer to close all libraries when closing state.
751*/
752static void createclibstable (lua_State *L) {
753 lua_newtable(L); /* create CLIBS table */
754 lua_createtable(L, 0, 1); /* create metatable for CLIBS */
755 lua_pushcfunction(L, gctm);
756 lua_setfield(L, -2, "__gc"); /* set finalizer for CLIBS table */
757 lua_setmetatable(L, -2);
758 lua_rawsetp(L, LUA_REGISTRYINDEX, &CLIBS); /* set CLIBS table in registry */
759}
760
761
762LUAMOD_API int luaopen_package (lua_State *L) {

Callers 1

luaopen_packageFunction · 0.85

Calls 4

lua_createtableFunction · 0.85
lua_setfieldFunction · 0.85
lua_setmetatableFunction · 0.85
lua_rawsetpFunction · 0.85

Tested by

no test coverage detected