diff options
author | Benoit 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 |
---|---|---|
committer | Benoit 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 |
commit | f823c6887e28c815234f8b4bd355887b4f554857 (patch) | |
tree | 862b37cc93d6779c3c2577e78ed6ff5389412f90 /src/keeper.h | |
parent | c97ad8630ea9dcb92b4e9db16c4dbade1de18884 (diff) | |
download | lanes-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.h | 11 |
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 | |||
18 | void close_keepers( void); | 18 | void close_keepers( void); |
19 | #endif // HAVE_KEEPER_ATEXIT_DESINIT | 19 | #endif // HAVE_KEEPER_ATEXIT_DESINIT |
20 | 20 | ||
21 | void populate_keepers( lua_State *L); | ||
22 | struct s_Keeper *keeper_acquire( const void *ptr); | 21 | struct s_Keeper *keeper_acquire( const void *ptr); |
23 | void keeper_release( struct s_Keeper *K); | 22 | void keeper_release( struct s_Keeper *K); |
24 | void keeper_toggle_nil_sentinels( lua_State *L, int _val_i, int _nil_to_sentinel); | 23 | void keeper_toggle_nil_sentinels( lua_State *L, int _val_i, int _nil_to_sentinel); |
25 | int keeper_push_linda_storage( lua_State* L, void* ptr); | 24 | int 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 | ||
32 | typedef 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 | ||
36 | typedef lua_CFunction keeper_api_t; | 26 | typedef 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); | |||
45 | int keepercall_get( lua_State* L); | 35 | int keepercall_get( lua_State* L); |
46 | int keepercall_set( lua_State* L); | 36 | int keepercall_set( lua_State* L); |
47 | int keepercall_count( lua_State* L); | 37 | int keepercall_count( lua_State* L); |
48 | #endif // KEEPER_MODEL | ||
49 | 38 | ||
50 | int keeper_call( lua_State *K, keeper_api_t _func, lua_State *L, void *linda, uint_t starting_index); | 39 | int keeper_call( lua_State *K, keeper_api_t _func, lua_State *L, void *linda, uint_t starting_index); |
51 | 40 | ||