MCPcopy Create free account
hub / github.com/DFHack/dfhack / add_luacov_coroutine_wrapper

Function add_luacov_coroutine_wrapper

library/LuaTools.cpp:952–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

950}
951
952static void add_luacov_coroutine_wrapper(lua_State *L)
953{
954 color_ostream *out = Lua::GetOutput(L);
955 if (!Lua::PushModulePublic(*out, L, "luacov_helper", "with_luacov"))
956 {
957 out->printerr("Failed to load luacov_helper.with_luacov.\n");
958 return;
959 }
960 lua_swap(L);
961 if (!Lua::SafeCall(*out, L, 1, 1))
962 out->printerr("Failed to set luacov monitoring wrapper.\n");
963}
964
965lua_State *DFHack::Lua::NewCoroutine(lua_State *L) {
966 if (Lua::IsCoreContext(L) && getenv("DFHACK_ENABLE_LUACOV"))

Callers 1

NewCoroutineMethod · 0.85

Calls 3

PushModulePublicFunction · 0.85
lua_swapFunction · 0.85
SafeCallFunction · 0.85

Tested by

no test coverage detected