diff options
Diffstat (limited to 'src/deep.h')
-rw-r--r-- | src/deep.h | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -42,18 +42,17 @@ typedef void* (*luaG_IdFunction)( lua_State* L, DeepOp op_); | |||
42 | // ################################################################################################ | 42 | // ################################################################################################ |
43 | 43 | ||
44 | // fnv164 of string "DEEP_VERSION_2" generated at https://www.pelock.com/products/hash-calculator | 44 | // fnv164 of string "DEEP_VERSION_2" generated at https://www.pelock.com/products/hash-calculator |
45 | static DECLARE_CONST_UNIQUE_KEY( DEEP_VERSION, 0xB4B0119C10642B29); | 45 | static constexpr UniqueKey DEEP_VERSION{ 0xB4B0119C10642B29ull }; |
46 | 46 | ||
47 | // should be used as header for full userdata | 47 | // should be used as header for full userdata |
48 | struct s_DeepPrelude | 48 | struct DeepPrelude |
49 | { | 49 | { |
50 | DECLARE_UNIQUE_KEY( magic); // must be filled by the Deep userdata idfunc that allocates it on eDO_new operation | 50 | UniqueKey const magic{ DEEP_VERSION }; |
51 | // when stored in a keeper state, the full userdata doesn't have a metatable, so we need direct access to the idfunc | 51 | // when stored in a keeper state, the full userdata doesn't have a metatable, so we need direct access to the idfunc |
52 | luaG_IdFunction idfunc; | 52 | luaG_IdFunction idfunc { nullptr }; |
53 | // data is destroyed when refcount is 0 | 53 | // data is destroyed when refcount is 0 |
54 | volatile int refcount; | 54 | volatile int refcount{ 0 }; |
55 | }; | 55 | }; |
56 | typedef struct s_DeepPrelude DeepPrelude; | ||
57 | 56 | ||
58 | char const* push_deep_proxy( Universe* U, lua_State* L, DeepPrelude* prelude, int nuv_, LookupMode mode_); | 57 | char const* push_deep_proxy( Universe* U, lua_State* L, DeepPrelude* prelude, int nuv_, LookupMode mode_); |
59 | void free_deep_prelude( lua_State* L, DeepPrelude* prelude_); | 58 | void free_deep_prelude( lua_State* L, DeepPrelude* prelude_); |