aboutsummaryrefslogtreecommitdiff
path: root/src/deep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/deep.c')
-rw-r--r--src/deep.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/deep.c b/src/deep.c
index 6a735b8..af7f580 100644
--- a/src/deep.c
+++ b/src/deep.c
@@ -123,13 +123,13 @@ void luaG_pushdeepversion( lua_State* L) { (void) lua_pushliteral( L, "ab8743e5-
123* idfunc -> metatable 123* idfunc -> metatable
124*/ 124*/
125// crc64/we of string "DEEP_LOOKUP_KEY" generated at http://www.nitrxgen.net/hashgen/ 125// crc64/we of string "DEEP_LOOKUP_KEY" generated at http://www.nitrxgen.net/hashgen/
126static DECLARE_CONST_UNIQUE_KEY( DEEP_LOOKUP_KEY, (void*)0x9fb9b4f3f633d83d); 126static DECLARE_CONST_UNIQUE_KEY( DEEP_LOOKUP_KEY, 0x9fb9b4f3f633d83d);
127 127
128/* 128/*
129 * The deep proxy cache is a weak valued table listing all deep UD proxies indexed by the deep UD that they are proxying 129 * The deep proxy cache is a weak valued table listing all deep UD proxies indexed by the deep UD that they are proxying
130 * crc64/we of string "DEEP_PROXY_CACHE_KEY" generated at http://www.nitrxgen.net/hashgen/ 130 * crc64/we of string "DEEP_PROXY_CACHE_KEY" generated at http://www.nitrxgen.net/hashgen/
131*/ 131*/
132static DECLARE_CONST_UNIQUE_KEY( DEEP_PROXY_CACHE_KEY, (void*)0x05773d6fc26be106); 132static DECLARE_CONST_UNIQUE_KEY( DEEP_PROXY_CACHE_KEY, 0x05773d6fc26be106);
133 133
134/* 134/*
135* Sets up [-1]<->[-2] two-way lookups, and ensures the lookup table exists. 135* Sets up [-1]<->[-2] two-way lookups, and ensures the lookup table exists.
@@ -302,7 +302,7 @@ char const* push_deep_proxy( Universe* U, lua_State* L, DeepPrelude* prelude, Lo
302 *proxy = prelude; 302 *proxy = prelude;
303 303
304 // Get/create metatable for 'idfunc' (in this state) 304 // Get/create metatable for 'idfunc' (in this state)
305 lua_pushlightuserdata( L, prelude->idfunc); // DPC proxy idfunc 305 lua_pushlightuserdata( L, (void*)(ptrdiff_t)(prelude->idfunc)); // DPC proxy idfunc
306 get_deep_lookup( L); // DPC proxy metatable? 306 get_deep_lookup( L); // DPC proxy metatable?
307 307
308 if( lua_isnil( L, -1)) // // No metatable yet. 308 if( lua_isnil( L, -1)) // // No metatable yet.
@@ -351,16 +351,16 @@ char const* push_deep_proxy( Universe* U, lua_State* L, DeepPrelude* prelude, Lo
351 351
352 // Memorize for later rounds 352 // Memorize for later rounds
353 lua_pushvalue( L, -1); // DPC proxy metatable metatable 353 lua_pushvalue( L, -1); // DPC proxy metatable metatable
354 lua_pushlightuserdata( L, prelude->idfunc); // DPC proxy metatable metatable idfunc 354 lua_pushlightuserdata( L, (void*)(ptrdiff_t)(prelude->idfunc)); // DPC proxy metatable metatable idfunc
355 set_deep_lookup( L); // DPC proxy metatable 355 set_deep_lookup( L); // DPC proxy metatable
356 356
357 // 2 - cause the target state to require the module that exported the idfunc 357 // 2 - cause the target state to require the module that exported the idfunc
358 // this is needed because we must make sure the shared library is still loaded as long as we hold a pointer on the idfunc 358 // this is needed because we must make sure the shared library is still loaded as long as we hold a pointer on the idfunc
359 { 359 {
360 int oldtop = lua_gettop( L); 360 int oldtop_module = lua_gettop( L);
361 modname = (char const*) prelude->idfunc( L, eDO_module); // DPC proxy metatable 361 modname = (char const*) prelude->idfunc( L, eDO_module); // DPC proxy metatable
362 // make sure the function pushed nothing on the stack! 362 // make sure the function pushed nothing on the stack!
363 if( lua_gettop( L) - oldtop != 0) 363 if( lua_gettop( L) - oldtop_module != 0)
364 { 364 {
365 lua_pop( L, 3); // 365 lua_pop( L, 3); //
366 return "Bad idfunc(eOP_module): should not push anything"; 366 return "Bad idfunc(eOP_module): should not push anything";