- Lauri
>From 44e327deeda7470f1cdef218bb900c4e41380e1a Mon Sep 17 00:00:00 2001 From: Lauri Kasanen <[email protected]> Date: Wed, 8 Aug 2012 17:13:52 +0300 Subject: [PATCH 3/5] cache: Inline cache_get, called ~4 times per request
Signed-off-by: Lauri Kasanen <[email protected]> --- src/include/mk_cache.h | 6 +++++- src/mk_cache.c | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/include/mk_cache.h b/src/include/mk_cache.h index f579c7a..c069ae6 100644 --- a/src/include/mk_cache.h +++ b/src/include/mk_cache.h @@ -31,6 +31,10 @@ extern pthread_key_t mk_cache_utils_gmtime; extern pthread_key_t mk_cache_utils_gmt_text; void mk_cache_thread_init(void); -void *mk_cache_get(pthread_key_t key); + +static inline void *mk_cache_get(pthread_key_t key) +{ + return pthread_getspecific(key); +} #endif diff --git a/src/mk_cache.c b/src/mk_cache.c index d5af883..2b294b6 100644 --- a/src/mk_cache.c +++ b/src/mk_cache.c @@ -88,8 +88,3 @@ void mk_cache_thread_init() cache_utils_gmt_text = mk_mem_malloc_z(sizeof(struct mk_gmt_cache) * MK_GMT_CACHES); pthread_setspecific(mk_cache_utils_gmt_text, (void *) cache_utils_gmt_text); } - -void *mk_cache_get(pthread_key_t key) -{ - return ( void *) pthread_getspecific(key); -} -- 1.7.2.1
_______________________________________________ Monkey mailing list [email protected] http://lists.monkey-project.com/listinfo/monkey
