MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / collectGarbage

Method collectGarbage

source/core/StarLua.cpp:559–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

557}
558
559void LuaEngine::collectGarbage(Maybe<unsigned> steps) {
560 for (auto handleIndex : take(m_handleFree)) {
561 lua_pushnil(m_handleThread);
562 lua_replace(m_handleThread, handleIndex);
563 }
564
565 if (steps)
566 lua_gc(m_state, LUA_GCSTEP, *steps);
567 else
568 lua_gc(m_state, LUA_GCCOLLECT, 0);
569}
570
571void LuaEngine::setAutoGarbageCollection(bool autoGarbageColleciton) {
572 lua_gc(m_state, LUA_GCSTOP, autoGarbageColleciton ? 1 : 0);

Callers 2

TESTFunction · 0.45
workerMainMethod · 0.45

Calls 3

takeFunction · 0.85
lua_pushnilFunction · 0.85
lua_gcFunction · 0.85

Tested by 1

TESTFunction · 0.36