Unfortunately, exceptions require some overhead in luajit... overhead we can't always accept on behalf of the user.

This commit is contained in:
ThePhD 2016-02-25 13:04:04 -05:00
parent 3f681eea0d
commit 1341aafa27
2 changed files with 3 additions and 1 deletions

View File

@ -144,7 +144,7 @@ inline void push_metatable(lua_State* L, bool needsindexfunction, Funcs&& funcs,
} }
// Otherwise, we use quick, fast table indexing for methods // Otherwise, we use quick, fast table indexing for methods
// gives us performance boost in calling them // gives us performance boost in calling them
lua_createtable(L, 0, functable.size()); lua_createtable(L, 0, static_cast<int>(functable.size()));
int up = stack::stack_detail::push_upvalues(L, funcs); int up = stack::stack_detail::push_upvalues(L, funcs);
luaL_setfuncs(L, functable.data(), up); luaL_setfuncs(L, functable.data(), up);
lua_setfield(L, metatableindex, "__index"); lua_setfield(L, metatableindex, "__index");

View File

@ -1162,6 +1162,7 @@ TEST_CASE("interop/null-to-nil-and-back", "nil should be the given type when a p
"assert(x == nil)")); "assert(x == nil)"));
} }
#ifdef SOL_LUAJIT // LuaJIT does not have error message handling support for lua_pcall, and thus this test will always fail
TEST_CASE( "functions/function_result-protected_function", "Function result should be the beefy return type for sol::function that allows for error checking and error handlers" ) { TEST_CASE( "functions/function_result-protected_function", "Function result should be the beefy return type for sol::function that allows for error checking and error handlers" ) {
sol::state lua; sol::state lua;
lua.open_libraries( sol::lib::base, sol::lib::debug ); lua.open_libraries( sol::lib::base, sol::lib::debug );
@ -1209,6 +1210,7 @@ TEST_CASE( "functions/function_result-protected_function", "Function result shou
errorstring = result2; errorstring = result2;
REQUIRE(errorstring == errormessage2); REQUIRE(errorstring == errormessage2);
} }
#endif // LuaJIT Issues
TEST_CASE("functions/destructor-tests", "Show that proper copies / destruction happens") { TEST_CASE("functions/destructor-tests", "Show that proper copies / destruction happens") {
static int created = 0; static int created = 0;