From 4b9c5a59a823df610c8c871d5c0cb47cbb7c42cd Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Wed, 31 Oct 2018 12:19:00 +0100 Subject: Another lua_pushlightuserdata->push_unique_key internal replacement --- src/lanes.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lanes.c b/src/lanes.c index 5a1f94a..aeba5fb 100644 --- a/src/lanes.c +++ b/src/lanes.c @@ -275,7 +275,8 @@ static DECLARE_CONST_UNIQUE_KEY( STACK_TRACE_KEY, 0x024d5411677ce879); * error (and maybe stack trace) parameters to the finalizer functions would * anyways complicate that approach. */ -#define FINALIZER_REG_KEY ((void*)LG_set_finalizer) +// crc64/we of string "STACK_TRACE_KEY" generated at http://www.nitrxgen.net/hashgen/ +static DECLARE_CONST_UNIQUE_KEY( FINALIZER_REG_KEY, 0x7902972781c7e365); struct s_Linda; @@ -301,11 +302,11 @@ struct s_Linda; * Returns: TRUE if a table was pushed * FALSE if no table found, not created, and nothing pushed */ -static bool_t push_registry_table( lua_State* L, void* key, bool_t create) +static bool_t push_registry_table( lua_State* L, UniqueKey key, bool_t create) { STACK_GROW( L, 3); STACK_CHECK( L); - lua_pushlightuserdata( L, key); // key + push_unique_key( L, key); // key lua_rawget( L, LUA_REGISTRYINDEX); // t? if( lua_isnil( L, -1)) // nil? @@ -318,7 +319,7 @@ static bool_t push_registry_table( lua_State* L, void* key, bool_t create) } lua_newtable( L); // t - lua_pushlightuserdata( L, key); // t key + push_unique_key( L, key); // t key lua_pushvalue( L, -2); // t key t lua_rawset( L, LUA_REGISTRYINDEX); // t } -- cgit v1.2.3-55-g6feb