diff options
Diffstat (limited to 'src/keeper.h')
-rw-r--r-- | src/keeper.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/keeper.h b/src/keeper.h index 627c7ea..7ec8b15 100644 --- a/src/keeper.h +++ b/src/keeper.h | |||
@@ -11,6 +11,7 @@ extern "C" { | |||
11 | #include "threading.h" | 11 | #include "threading.h" |
12 | #include "uniquekey.h" | 12 | #include "uniquekey.h" |
13 | 13 | ||
14 | #include <optional> | ||
14 | #include <mutex> | 15 | #include <mutex> |
15 | 16 | ||
16 | // forwards | 17 | // forwards |
@@ -33,7 +34,7 @@ struct Keepers | |||
33 | 34 | ||
34 | static constexpr uintptr_t KEEPER_MAGIC_SHIFT{ 3 }; | 35 | static constexpr uintptr_t KEEPER_MAGIC_SHIFT{ 3 }; |
35 | // crc64/we of string "NIL_SENTINEL" generated at http://www.nitrxgen.net/hashgen/ | 36 | // crc64/we of string "NIL_SENTINEL" generated at http://www.nitrxgen.net/hashgen/ |
36 | static constexpr UniqueKey NIL_SENTINEL{ 0x7eaafa003a1d11a1ull }; | 37 | static constexpr UniqueKey NIL_SENTINEL{ 0x7eaafa003a1d11a1ull, "internal nil sentinel" }; |
37 | 38 | ||
38 | void init_keepers(Universe* U, lua_State* L); | 39 | void init_keepers(Universe* U, lua_State* L); |
39 | void close_keepers(Universe* U); | 40 | void close_keepers(Universe* U); |
@@ -57,4 +58,5 @@ using keeper_api_t = lua_CFunction; | |||
57 | [[nodiscard]] int keepercall_set(lua_State* L); | 58 | [[nodiscard]] int keepercall_set(lua_State* L); |
58 | [[nodiscard]] int keepercall_count(lua_State* L); | 59 | [[nodiscard]] int keepercall_count(lua_State* L); |
59 | 60 | ||
60 | [[nodiscard]] int keeper_call(Universe* U, lua_State* K, keeper_api_t _func, lua_State* L, void* linda, int starting_index); | 61 | using KeeperCallResult = Unique<std::optional<int>>; |
62 | [[nodiscard]] KeeperCallResult keeper_call(Universe* U, lua_State* K, keeper_api_t _func, lua_State* L, void* linda, int starting_index); | ||