aboutsummaryrefslogtreecommitdiff
path: root/src/deep.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/deep.h')
-rw-r--r--src/deep.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/deep.h b/src/deep.h
index 728aa2a..d8a1772 100644
--- a/src/deep.h
+++ b/src/deep.h
@@ -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
45static DECLARE_CONST_UNIQUE_KEY( DEEP_VERSION, 0xB4B0119C10642B29); 45static 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
48struct s_DeepPrelude 48struct 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};
56typedef struct s_DeepPrelude DeepPrelude;
57 56
58char const* push_deep_proxy( Universe* U, lua_State* L, DeepPrelude* prelude, int nuv_, LookupMode mode_); 57char const* push_deep_proxy( Universe* U, lua_State* L, DeepPrelude* prelude, int nuv_, LookupMode mode_);
59void free_deep_prelude( lua_State* L, DeepPrelude* prelude_); 58void free_deep_prelude( lua_State* L, DeepPrelude* prelude_);