MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / createclibstable

Function createclibstable

lib/lua/src/loadlib.c:726–732  ·  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

724** setting a finalizer to close all libraries when closing state.
725*/
726static void createclibstable (lua_State *L) {
727 luaL_getsubtable(L, LUA_REGISTRYINDEX, CLIBS); /* create CLIBS table */
728 lua_createtable(L, 0, 1); /* create metatable for CLIBS */
729 lua_pushcfunction(L, gctm);
730 lua_setfield(L, -2, "__gc"); /* set finalizer for CLIBS table */
731 lua_setmetatable(L, -2);
732}
733
734
735LUAMOD_API int luaopen_package (lua_State *L) {

Callers 1

luaopen_packageFunction · 0.85

Calls 4

luaL_getsubtableFunction · 0.85
lua_createtableFunction · 0.85
lua_setfieldFunction · 0.85
lua_setmetatableFunction · 0.85

Tested by

no test coverage detected