summaryrefslogtreecommitdiff
path: root/memcached.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2020-08-30 17:20:06 -0700
committerdormando <dormando@rydia.net>2020-10-30 15:50:12 -0700
commit0d4cd8af759ff29562cf17a91ed7f909f88f6e32 (patch)
tree74e39f7be31d442b22bb7910d50fe226edfb7252 /memcached.h
parente5326570b34ad3171e8d685e6bd17b58928d06cd (diff)
downloadmemcached-0d4cd8af759ff29562cf17a91ed7f909f88f6e32.tar.gz
core: io_pending_t is an embeddable struct
reserve space in an io_pending_t. users cast it to a more specific structure, avoiding extra allocations for local data. In this case what might require 3 allocs stays as just 1.
Diffstat (limited to 'memcached.h')
-rw-r--r--memcached.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/memcached.h b/memcached.h
index 31687d8..73253c6 100644
--- a/memcached.h
+++ b/memcached.h
@@ -670,15 +670,9 @@ typedef struct conn conn;
#define IO_QUEUE_EXTSTORE 1
typedef struct _io_pending_t {
struct _io_pending_t *next;
- void *io_ctx;
conn *c;
- item *hdr_it; /* original header item. */
mc_resp *resp; /* associated response object */
- unsigned int iovec_data; /* specific index of data iovec */
- bool noreply; /* whether the response had noreply set */
- bool miss; /* signal a miss to unlink hdr_it */
- bool badcrc; /* signal a crc failure */
- bool active; /* tells if IO was dispatched or not */
+ char data[120];
} io_pending_t;
typedef void (*io_queue_add_cb)(void *ctx, io_pending_t *pending);