diff options
author | dormando <dormando@rydia.net> | 2021-07-28 00:15:45 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2021-08-09 17:09:08 -0700 |
commit | e52734366c94475db33d3239f48b4542ec2d9c2f (patch) | |
tree | 2a4ba068dcf8005aa3082d0c749437689fc6d978 /thread.c | |
parent | 38bc6e3513ad3783bb710120d66e84725e961fae (diff) | |
download | memcached-e52734366c94475db33d3239f48b4542ec2d9c2f.tar.gz |
core: cache.c cleanups, use queue.h freelist
cache constructors/destructors were never used, which just ended up
being wasted branches. Since there's no constructor/destructor for cache
objects, we can use the memory itself for the freelist.
This removes a doubling realloc for the freelist of cache objects and
simplifies the code a bunch.
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -424,7 +424,7 @@ static void setup_thread(LIBEVENT_THREAD *me) { exit(EXIT_FAILURE); } - me->rbuf_cache = cache_create("rbuf", READ_BUFFER_SIZE, sizeof(char *), NULL, NULL); + me->rbuf_cache = cache_create("rbuf", READ_BUFFER_SIZE, sizeof(char *)); if (me->rbuf_cache == NULL) { fprintf(stderr, "Failed to create read buffer cache\n"); exit(EXIT_FAILURE); @@ -441,7 +441,7 @@ static void setup_thread(LIBEVENT_THREAD *me) { cache_set_limit(me->rbuf_cache, limit); } - me->io_cache = cache_create("io", sizeof(io_pending_t), sizeof(char*), NULL, NULL); + me->io_cache = cache_create("io", sizeof(io_pending_t), sizeof(char*)); if (me->io_cache == NULL) { fprintf(stderr, "Failed to create IO object cache\n"); exit(EXIT_FAILURE); |