diff options
Diffstat (limited to 'src/keeper.h')
-rw-r--r-- | src/keeper.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/keeper.h b/src/keeper.h index ce9742a..5f52fa0 100644 --- a/src/keeper.h +++ b/src/keeper.h | |||
@@ -19,7 +19,7 @@ struct Keeper | |||
19 | { | 19 | { |
20 | MUTEX_T keeper_cs; | 20 | MUTEX_T keeper_cs; |
21 | lua_State* L; | 21 | lua_State* L; |
22 | //int count; | 22 | // int count; |
23 | }; | 23 | }; |
24 | 24 | ||
25 | struct Keepers | 25 | struct Keepers |
@@ -28,30 +28,30 @@ struct Keepers | |||
28 | Keeper keeper_array[1]; | 28 | Keeper keeper_array[1]; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | void init_keepers( Universe* U, lua_State* L); | 31 | static constexpr ptrdiff_t KEEPER_MAGIC_SHIFT{ 3 }; |
32 | void close_keepers( Universe* U); | ||
33 | |||
34 | Keeper* which_keeper( Keepers* keepers_, ptrdiff_t magic_); | ||
35 | Keeper* keeper_acquire( Keepers* keepers_, ptrdiff_t magic_); | ||
36 | #define KEEPER_MAGIC_SHIFT 3 | ||
37 | void keeper_release( Keeper* K); | ||
38 | void keeper_toggle_nil_sentinels( lua_State* L, int val_i_, LookupMode const mode_); | ||
39 | int keeper_push_linda_storage( Universe* U, lua_State* L, void* ptr_, ptrdiff_t magic_); | ||
40 | |||
41 | // crc64/we of string "NIL_SENTINEL" generated at http://www.nitrxgen.net/hashgen/ | 32 | // crc64/we of string "NIL_SENTINEL" generated at http://www.nitrxgen.net/hashgen/ |
42 | static constexpr UniqueKey NIL_SENTINEL{ 0x7eaafa003a1d11a1ull }; | 33 | static constexpr UniqueKey NIL_SENTINEL{ 0x7eaafa003a1d11a1ull }; |
43 | 34 | ||
35 | void init_keepers(Universe* U, lua_State* L); | ||
36 | void close_keepers(Universe* U); | ||
37 | |||
38 | Keeper* which_keeper(Keepers* keepers_, ptrdiff_t magic_); | ||
39 | Keeper* keeper_acquire(Keepers* keepers_, ptrdiff_t magic_); | ||
40 | void keeper_release(Keeper* K); | ||
41 | void keeper_toggle_nil_sentinels(lua_State* L, int val_i_, LookupMode const mode_); | ||
42 | int keeper_push_linda_storage(Universe* U, lua_State* L, void* ptr_, ptrdiff_t magic_); | ||
43 | |||
44 | using keeper_api_t = lua_CFunction; | 44 | using keeper_api_t = lua_CFunction; |
45 | #define KEEPER_API( _op) keepercall_ ## _op | 45 | #define KEEPER_API(_op) keepercall_##_op |
46 | #define PUSH_KEEPER_FUNC lua_pushcfunction | 46 | #define PUSH_KEEPER_FUNC lua_pushcfunction |
47 | // lua_Cfunctions to run inside a keeper state (formerly implemented in Lua) | 47 | // lua_Cfunctions to run inside a keeper state |
48 | int keepercall_clear( lua_State* L); | 48 | int keepercall_clear(lua_State* L); |
49 | int keepercall_send( lua_State* L); | 49 | int keepercall_send(lua_State* L); |
50 | int keepercall_receive( lua_State* L); | 50 | int keepercall_receive(lua_State* L); |
51 | int keepercall_receive_batched( lua_State* L); | 51 | int keepercall_receive_batched(lua_State* L); |
52 | int keepercall_limit( lua_State* L); | 52 | int keepercall_limit(lua_State* L); |
53 | int keepercall_get( lua_State* L); | 53 | int keepercall_get(lua_State* L); |
54 | int keepercall_set( lua_State* L); | 54 | int keepercall_set(lua_State* L); |
55 | int keepercall_count( lua_State* L); | 55 | int keepercall_count(lua_State* L); |
56 | 56 | ||
57 | int keeper_call(Universe* U, lua_State* K, keeper_api_t _func, lua_State* L, void* linda, int starting_index); | 57 | int keeper_call(Universe* U, lua_State* K, keeper_api_t _func, lua_State* L, void* linda, int starting_index); |