aboutsummaryrefslogtreecommitdiff
path: root/src/keeper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/keeper.cpp')
-rw-r--r--src/keeper.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/keeper.cpp b/src/keeper.cpp
index 37fcba5..f56c50c 100644
--- a/src/keeper.cpp
+++ b/src/keeper.cpp
@@ -656,7 +656,7 @@ void init_keepers(Universe* U, lua_State* L)
656 lua_pop(L, 1); // 656 lua_pop(L, 1); //
657 if (nb_keepers < 1) 657 if (nb_keepers < 1)
658 { 658 {
659 std::ignore = luaL_error(L, "Bad number of keepers (%d)", nb_keepers); // doesn't return 659 luaL_error(L, "Bad number of keepers (%d)", nb_keepers); // doesn't return
660 } 660 }
661 STACK_CHECK(L, 0); 661 STACK_CHECK(L, 0);
662 662
@@ -671,7 +671,7 @@ void init_keepers(Universe* U, lua_State* L)
671 U->keepers = static_cast<Keepers*>(U->internal_allocator.alloc(bytes)); 671 U->keepers = static_cast<Keepers*>(U->internal_allocator.alloc(bytes));
672 if (U->keepers == nullptr) 672 if (U->keepers == nullptr)
673 { 673 {
674 std::ignore = luaL_error(L, "init_keepers() failed while creating keeper array; out of memory"); // doesn't return 674 luaL_error(L, "init_keepers() failed while creating keeper array; out of memory"); // doesn't return
675 } 675 }
676 U->keepers->Keepers::Keepers(); 676 U->keepers->Keepers::Keepers();
677 U->keepers->gc_threshold = keepers_gc_threshold; 677 U->keepers->gc_threshold = keepers_gc_threshold;
@@ -688,7 +688,7 @@ void init_keepers(Universe* U, lua_State* L)
688 lua_State* const K{ create_state(U, L) }; 688 lua_State* const K{ create_state(U, L) };
689 if (K == nullptr) 689 if (K == nullptr)
690 { 690 {
691 std::ignore = luaL_error(L, "init_keepers() failed while creating keeper states; out of memory"); // doesn't return 691 luaL_error(L, "init_keepers() failed while creating keeper states; out of memory"); // doesn't return
692 } 692 }
693 693
694 U->keepers->keeper_array[i].L = K; 694 U->keepers->keeper_array[i].L = K;
@@ -717,7 +717,7 @@ void init_keepers(Universe* U, lua_State* L)
717 if (!lua_isnil(L, -1)) 717 if (!lua_isnil(L, -1))
718 { 718 {
719 // when copying with mode LookupMode::ToKeeper, error message is pushed at the top of the stack, not raised immediately 719 // when copying with mode LookupMode::ToKeeper, error message is pushed at the top of the stack, not raised immediately
720 if (luaG_inter_copy_package(U, Source{ L }, Dest{ K }, -1, LookupMode::ToKeeper)) 720 if (luaG_inter_copy_package(U, Source{ L }, Dest{ K }, -1, LookupMode::ToKeeper) != InterCopyResult::Success)
721 { 721 {
722 // if something went wrong, the error message is at the top of the stack 722 // if something went wrong, the error message is at the top of the stack
723 lua_remove(L, -2); // error_msg 723 lua_remove(L, -2); // error_msg
@@ -840,7 +840,7 @@ int keeper_call(Universe* U, lua_State* K, keeper_api_t func_, lua_State* L, voi
840 840
841 lua_pushlightuserdata(K, linda); 841 lua_pushlightuserdata(K, linda);
842 842
843 if ((args == 0) || luaG_inter_copy(U, Source{ L }, Dest{ K }, args, LookupMode::ToKeeper) == 0) // L->K 843 if ((args == 0) || luaG_inter_copy(U, Source{ L }, Dest{ K }, args, LookupMode::ToKeeper) == InterCopyResult::Success) // L->K
844 { 844 {
845 lua_call(K, 1 + args, LUA_MULTRET); 845 lua_call(K, 1 + args, LUA_MULTRET);
846 retvals = lua_gettop(K) - Ktos; 846 retvals = lua_gettop(K) - Ktos;
@@ -848,7 +848,7 @@ int keeper_call(Universe* U, lua_State* K, keeper_api_t func_, lua_State* L, voi
848 // this may interrupt a lane, causing the destruction of the underlying OS thread 848 // this may interrupt a lane, causing the destruction of the underlying OS thread
849 // after this, another lane making use of this keeper can get an error code from the mutex-locking function 849 // after this, another lane making use of this keeper can get an error code from the mutex-locking function
850 // when attempting to grab the mutex again (WINVER <= 0x400 does this, but locks just fine, I don't know about pthread) 850 // when attempting to grab the mutex again (WINVER <= 0x400 does this, but locks just fine, I don't know about pthread)
851 if ((retvals > 0) && luaG_inter_move(U, Source{ K }, Dest{ L }, retvals, LookupMode::FromKeeper) != 0) // K->L 851 if ((retvals > 0) && luaG_inter_move(U, Source{ K }, Dest{ L }, retvals, LookupMode::FromKeeper) != InterCopyResult::Success) // K->L
852 { 852 {
853 retvals = -1; 853 retvals = -1;
854 } 854 }