| 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); |
nothing calls this directly
no test coverage detected