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

Function gctm

lib/lua/src/loadlib.c:354–362  ·  view source on GitHub ↗

** __gc tag method for CLIBS table: calls 'lsys_unloadlib' for all lib ** handles in list CLIBS */

Source from the content-addressed store, hash-verified

352** handles in list CLIBS
353*/
354static int gctm (lua_State *L) {
355 lua_Integer n = luaL_len(L, 1);
356 for (; n >= 1; n--) { /* for each handle, in reverse order */
357 lua_rawgeti(L, 1, n); /* get handle CLIBS[n] */
358 lsys_unloadlib(lua_touserdata(L, -1));
359 lua_pop(L, 1); /* pop handle */
360 }
361 return 0;
362}
363
364
365

Callers

nothing calls this directly

Calls 3

lua_rawgetiFunction · 0.85
lsys_unloadlibFunction · 0.85
lua_touserdataFunction · 0.85

Tested by

no test coverage detected