diff options
Diffstat (limited to 'src/lanes_private.h')
-rw-r--r-- | src/lanes_private.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lanes_private.h b/src/lanes_private.h index 309b632..196a346 100644 --- a/src/lanes_private.h +++ b/src/lanes_private.h | |||
@@ -10,6 +10,14 @@ | |||
10 | #include <stop_token> | 10 | #include <stop_token> |
11 | #include <thread> | 11 | #include <thread> |
12 | 12 | ||
13 | // The chain is ended by '(Lane*)(-1)', not nullptr: 'selfdestructFirst -> ... -> ... -> (-1)' | ||
14 | #define SELFDESTRUCT_END ((Lane*) (-1)) | ||
15 | |||
16 | // must be a #define instead of a constexpr to work with lua_pushliteral (until I templatize it) | ||
17 | #define kLaneMetatableName "Lane" | ||
18 | #define kLanesLibName "lanes" | ||
19 | #define kLanesCoreLibName kLanesLibName ".core" | ||
20 | |||
13 | // NOTE: values to be changed by either thread, during execution, without | 21 | // NOTE: values to be changed by either thread, during execution, without |
14 | // locking, are marked "volatile" | 22 | // locking, are marked "volatile" |
15 | // | 23 | // |
@@ -102,5 +110,5 @@ static constexpr RegistryUniqueKey kLanePointerRegKey{ 0x2D8CF03FE9F0A51Aull }; | |||
102 | // | 110 | // |
103 | [[nodiscard]] inline Lane* ToLane(lua_State* L_, int i_) | 111 | [[nodiscard]] inline Lane* ToLane(lua_State* L_, int i_) |
104 | { | 112 | { |
105 | return *(static_cast<Lane**>(luaL_checkudata(L_, i_, "Lane"))); | 113 | return *(static_cast<Lane**>(luaL_checkudata(L_, i_, kLaneMetatableName))); |
106 | } | 114 | } |