MCPcopy Create free account
hub / github.com/ThePhD/sol2 / coroutine_create_guard

Function coroutine_create_guard

include/sol/stack_core.hpp:813–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

811 }
812
813 inline void coroutine_create_guard(lua_State* L) {
814 if (is_main_thread(L)) {
815 return;
816 }
817 int stacksize = lua_gettop(L);
818 if (stacksize < 1) {
819 return;
820 }
821 if (type_of(L, 1) != type::function) {
822 return;
823 }
824 // well now we're screwed...
825 // we can clean the stack and pray it doesn't destroy anything?
826 lua_pop(L, stacksize);
827 }
828
829 inline void clear(lua_State* L, int table_index) {
830 lua_pushnil(L);

Callers

nothing calls this directly

Calls 2

is_main_threadFunction · 0.85
type_ofFunction · 0.85

Tested by

no test coverage detected