aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compat.h1
-rw-r--r--src/keeper.c4
-rw-r--r--src/keeper.h6
-rw-r--r--src/lanes.c4
4 files changed, 8 insertions, 7 deletions
diff --git a/src/compat.h b/src/compat.h
index 6048974..998edef 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -43,6 +43,7 @@ void luaL_requiref (lua_State* L, const char* modname, lua_CFunction openf, int
43#endif // lua_lessthan 43#endif // lua_lessthan
44#define luaG_registerlibfuncs( L, _funcs) luaL_setfuncs( L, _funcs, 0) 44#define luaG_registerlibfuncs( L, _funcs) luaL_setfuncs( L, _funcs, 0)
45#define lua503_dump lua_dump 45#define lua503_dump lua_dump
46#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d)))
46#endif // LUA_VERSION_NUM == 503 47#endif // LUA_VERSION_NUM == 503
47 48
48#endif // __COMPAT_H__ 49#endif // __COMPAT_H__
diff --git a/src/keeper.c b/src/keeper.c
index ea061ce..ef0bacf 100644
--- a/src/keeper.c
+++ b/src/keeper.c
@@ -183,7 +183,7 @@ static void push_table( lua_State* L, int idx_)
183 STACK_END( L, 1); 183 STACK_END( L, 1);
184} 184}
185 185
186int keeper_push_linda_storage( struct s_Universe* U, lua_State* L, void* ptr_, unsigned long magic_) 186int keeper_push_linda_storage( struct s_Universe* U, lua_State* L, void* ptr_, ptrdiff_t magic_)
187{ 187{
188 struct s_Keeper* const K = keeper_acquire( U->keepers, magic_); 188 struct s_Keeper* const K = keeper_acquire( U->keepers, magic_);
189 lua_State* const KL = K ? K->L : NULL; 189 lua_State* const KL = K ? K->L : NULL;
@@ -717,7 +717,7 @@ void init_keepers( struct s_Universe* U, lua_State* L)
717 STACK_END( L, 0); 717 STACK_END( L, 0);
718} 718}
719 719
720struct s_Keeper* keeper_acquire( struct s_Keepers* keepers_, unsigned long magic_) 720struct s_Keeper* keeper_acquire( struct s_Keepers* keepers_, ptrdiff_t magic_)
721{ 721{
722 int const nbKeepers = keepers_->nb_keepers; 722 int const nbKeepers = keepers_->nb_keepers;
723 // can be 0 if this happens during main state shutdown (lanes is being GC'ed -> no keepers) 723 // can be 0 if this happens during main state shutdown (lanes is being GC'ed -> no keepers)
diff --git a/src/keeper.h b/src/keeper.h
index 6ca4ad4..7dbbc16 100644
--- a/src/keeper.h
+++ b/src/keeper.h
@@ -17,11 +17,11 @@ struct s_Keepers
17void init_keepers( struct s_Universe* U, lua_State* L); 17void init_keepers( struct s_Universe* U, lua_State* L);
18void close_keepers( struct s_Universe* U, lua_State* L); 18void close_keepers( struct s_Universe* U, lua_State* L);
19 19
20struct s_Keeper* keeper_acquire( struct s_Keepers* keepers_, unsigned long magic_); 20struct s_Keeper* keeper_acquire( struct s_Keepers* keepers_, ptrdiff_t magic_);
21#define KEEPER_MAGIC_SHIFT 3 21#define KEEPER_MAGIC_SHIFT 3
22void keeper_release( struct s_Keeper* K); 22void keeper_release( struct s_Keeper* K);
23void keeper_toggle_nil_sentinels( lua_State* L, int _val_i, enum eLookupMode const mode_); 23void keeper_toggle_nil_sentinels( lua_State* L, int val_i_, enum eLookupMode const mode_);
24int keeper_push_linda_storage( struct s_Universe* U, lua_State* L, void* ptr, unsigned long magic_); 24int keeper_push_linda_storage( struct s_Universe* U, lua_State* L, void* ptr_, ptrdiff_t magic_);
25 25
26#define NIL_SENTINEL ((void*)keeper_toggle_nil_sentinels) 26#define NIL_SENTINEL ((void*)keeper_toggle_nil_sentinels)
27 27
diff --git a/src/lanes.c b/src/lanes.c
index 2cb1af8..ef08e3a 100644
--- a/src/lanes.c
+++ b/src/lanes.c
@@ -413,11 +413,11 @@ struct s_Linda
413 SIGNAL_T read_happened; 413 SIGNAL_T read_happened;
414 SIGNAL_T write_happened; 414 SIGNAL_T write_happened;
415 struct s_Universe* U; // the universe this linda belongs to 415 struct s_Universe* U; // the universe this linda belongs to
416 ptrdiff_t group; // a group to control keeper allocation between lindas
416 enum e_cancel_request simulate_cancel; 417 enum e_cancel_request simulate_cancel;
417 unsigned long group; // a group to control keeper allocation between lindas
418 char name[1]; 418 char name[1];
419}; 419};
420#define LINDA_KEEPER_HASHSEED( linda) (linda->group ? linda->group : (unsigned long)linda) 420#define LINDA_KEEPER_HASHSEED( linda) (linda->group ? linda->group : (ptrdiff_t)linda)
421 421
422static void* linda_id( lua_State*, enum eDeepOp); 422static void* linda_id( lua_State*, enum eDeepOp);
423 423