summaryrefslogtreecommitdiff
path: root/memcached.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2023-01-11 13:48:01 -0800
committerdormando <dormando@rydia.net>2023-01-12 12:18:36 -0800
commit0e87c6dd86d8a50ddd56fbce445fb18e498e7f5f (patch)
treef765a633c116c9e9dd7cf94f6d41be3c01464486 /memcached.h
parent80fa3c7654c90c548b9857a9bbcfc494459f8cad (diff)
downloadmemcached-0e87c6dd86d8a50ddd56fbce445fb18e498e7f5f.tar.gz
core: remove *c from some response code
Allow freeing client response objects without the client object. Clean some confusing logic around clearing memory. Also exposes an interface for allocating unlinked response objects.
Diffstat (limited to 'memcached.h')
-rw-r--r--memcached.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/memcached.h b/memcached.h
index bdfa945..4790c75 100644
--- a/memcached.h
+++ b/memcached.h
@@ -984,8 +984,8 @@ int stop_conn_timeout_thread(void);
#define refcount_decr(it) --(it->refcount)
void STATS_LOCK(void);
void STATS_UNLOCK(void);
-#define THR_STATS_LOCK(c) pthread_mutex_lock(&c->thread->stats.mutex)
-#define THR_STATS_UNLOCK(c) pthread_mutex_unlock(&c->thread->stats.mutex)
+#define THR_STATS_LOCK(t) pthread_mutex_lock(&t->stats.mutex)
+#define THR_STATS_UNLOCK(t) pthread_mutex_unlock(&t->stats.mutex)
void threadlocal_stats_reset(void);
void threadlocal_stats_aggregate(struct thread_stats *stats);
void slab_stats_aggregate(struct thread_stats *stats, struct slab_stats *out);
@@ -1014,7 +1014,9 @@ void resp_reset(mc_resp *resp);
void resp_add_iov(mc_resp *resp, const void *buf, int len);
void resp_add_chunked_iov(mc_resp *resp, const void *buf, int len);
bool resp_start(conn *c);
+mc_resp *resp_start_unlinked(conn *c);
mc_resp* resp_finish(conn *c, mc_resp *resp);
+void resp_free(LIBEVENT_THREAD *th, mc_resp *resp);
bool resp_has_stack(conn *c);
bool rbuf_switch_to_malloc(conn *c);
void conn_release_items(conn *c);