aboutsummaryrefslogtreecommitdiff
path: root/src/keeper.h
diff options
context:
space:
mode:
authorBenoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m>2013-09-26 21:11:24 +0200
committerBenoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m>2013-09-26 21:11:24 +0200
commitf823c6887e28c815234f8b4bd355887b4f554857 (patch)
tree862b37cc93d6779c3c2577e78ed6ff5389412f90 /src/keeper.h
parentc97ad8630ea9dcb92b4e9db16c4dbade1de18884 (diff)
downloadlanes-f823c6887e28c815234f8b4bd355887b4f554857.tar.gz
lanes-f823c6887e28c815234f8b4bd355887b4f554857.tar.bz2
lanes-f823c6887e28c815234f8b4bd355887b4f554857.zip
Reduce memory footprint, simplify module order setup in conjuction with Lanes, and send over native functions a bit faster as well
* Lanes no longer has to internally require modules inside the keeper states because they no longer need a lookup database. the lookup name is stored as-is and actually converted in the destination state * optimisation: bypass cache when sending native functions over * removed all the KEEPER_MODEL_LUA code, as it can no longer work anyway
Diffstat (limited to 'src/keeper.h')
-rw-r--r--src/keeper.h11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/keeper.h b/src/keeper.h
index 29a19a9..420eca1 100644
--- a/src/keeper.h
+++ b/src/keeper.h
@@ -18,21 +18,11 @@ char const* init_keepers( lua_State* L, int _on_state_create, int const _nbKeepe
18void close_keepers( void); 18void close_keepers( void);
19#endif // HAVE_KEEPER_ATEXIT_DESINIT 19#endif // HAVE_KEEPER_ATEXIT_DESINIT
20 20
21void populate_keepers( lua_State *L);
22struct s_Keeper *keeper_acquire( const void *ptr); 21struct s_Keeper *keeper_acquire( const void *ptr);
23void keeper_release( struct s_Keeper *K); 22void keeper_release( struct s_Keeper *K);
24void keeper_toggle_nil_sentinels( lua_State *L, int _val_i, int _nil_to_sentinel); 23void keeper_toggle_nil_sentinels( lua_State *L, int _val_i, int _nil_to_sentinel);
25int keeper_push_linda_storage( lua_State* L, void* ptr); 24int keeper_push_linda_storage( lua_State* L, void* ptr);
26 25
27#define KEEPER_MODEL_LUA 1
28#define KEEPER_MODEL_C 2
29#define KEEPER_MODEL KEEPER_MODEL_C
30
31#if KEEPER_MODEL == KEEPER_MODEL_LUA
32typedef char const* keeper_api_t;
33#define KEEPER_API( _op) #_op
34#define PUSH_KEEPER_FUNC( K, _api) lua_getglobal( K, _api)
35#elif KEEPER_MODEL == KEEPER_MODEL_C
36typedef lua_CFunction keeper_api_t; 26typedef lua_CFunction keeper_api_t;
37#define KEEPER_API( _op) keepercall_ ## _op 27#define KEEPER_API( _op) keepercall_ ## _op
38#define PUSH_KEEPER_FUNC lua_pushcfunction 28#define PUSH_KEEPER_FUNC lua_pushcfunction
@@ -45,7 +35,6 @@ int keepercall_limit( lua_State* L);
45int keepercall_get( lua_State* L); 35int keepercall_get( lua_State* L);
46int keepercall_set( lua_State* L); 36int keepercall_set( lua_State* L);
47int keepercall_count( lua_State* L); 37int keepercall_count( lua_State* L);
48#endif // KEEPER_MODEL
49 38
50int keeper_call( lua_State *K, keeper_api_t _func, lua_State *L, void *linda, uint_t starting_index); 39int keeper_call( lua_State *K, keeper_api_t _func, lua_State *L, void *linda, uint_t starting_index);
51 40