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

Function luajit_exception_handler

include/sol/stack.hpp:336–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334 }
335
336 inline void luajit_exception_handler(lua_State* L, int (*handler)(lua_State*, lua_CFunction) = detail::c_trampoline) {
337#if SOL_IS_ON(SOL_USE_LUAJIT_EXCEPTION_TRAMPOLINE)
338 if (L == nullptr) {
339 return;
340 }
341#if SOL_IS_ON(SOL_SAFE_STACK_CHECK)
342 luaL_checkstack(L, 1, detail::not_enough_stack_space_generic);
343#endif // make sure stack doesn't overflow
344 lua_pushlightuserdata(L, (void*)handler);
345 auto pn = pop_n(L, 1);
346 luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC | LUAJIT_MODE_ON);
347#else
348 (void)L;
349 (void)handler;
350#endif
351 }
352
353 inline void luajit_exception_off(lua_State* L) {
354#if SOL_IS_ON(SOL_USE_LUAJIT_EXCEPTION_TRAMPOLINE)

Callers 1

set_default_stateFunction · 0.85

Calls 2

luaL_checkstackFunction · 0.85
pop_nFunction · 0.85

Tested by

no test coverage detected