aboutsummaryrefslogtreecommitdiff
path: root/src/keeper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keeper.c')
-rw-r--r--src/keeper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/keeper.c b/src/keeper.c
index 4eb8bb3..9b77c75 100644
--- a/src/keeper.c
+++ b/src/keeper.c
@@ -186,9 +186,9 @@ static void push_table( lua_State* L, int idx)
186 STACK_END( L, 1); 186 STACK_END( L, 1);
187} 187}
188 188
189int keeper_push_linda_storage( lua_State* L, void* ptr) 189int keeper_push_linda_storage( lua_State* L, void* ptr, unsigned long magic_)
190{ 190{
191 struct s_Keeper* K = keeper_acquire( ptr); 191 struct s_Keeper* K = keeper_acquire( magic_);
192 lua_State* KL = K ? K->L : NULL; 192 lua_State* KL = K ? K->L : NULL;
193 if( KL == NULL) return 0; 193 if( KL == NULL) return 0;
194 STACK_GROW( KL, 4); 194 STACK_GROW( KL, 4);
@@ -685,7 +685,7 @@ char const* init_keepers( lua_State* L)
685 return NULL; // ok 685 return NULL; // ok
686} 686}
687 687
688struct s_Keeper* keeper_acquire( void const* ptr) 688struct s_Keeper* keeper_acquire( unsigned long magic_)
689{ 689{
690 // can be 0 if this happens during main state shutdown (lanes is being GC'ed -> no keepers) 690 // can be 0 if this happens during main state shutdown (lanes is being GC'ed -> no keepers)
691 if( GNbKeepers == 0) 691 if( GNbKeepers == 0)
@@ -701,7 +701,7 @@ struct s_Keeper* keeper_acquire( void const* ptr)
701 * Pointers are often aligned by 8 or so - ignore the low order bits 701 * Pointers are often aligned by 8 or so - ignore the low order bits
702 * have to cast to unsigned long to avoid compilation warnings about loss of data when converting pointer-to-integer 702 * have to cast to unsigned long to avoid compilation warnings about loss of data when converting pointer-to-integer
703 */ 703 */
704 unsigned int i = (unsigned int)(((unsigned long)(ptr) >> 3) % GNbKeepers); 704 unsigned int i = (unsigned int)((magic_ >> KEEPER_MAGIC_SHIFT) % GNbKeepers);
705 struct s_Keeper* K= &GKeepers[i]; 705 struct s_Keeper* K= &GKeepers[i];
706 706
707 MUTEX_LOCK( &K->lock_); 707 MUTEX_LOCK( &K->lock_);