From 0d4cd8af759ff29562cf17a91ed7f909f88f6e32 Mon Sep 17 00:00:00 2001 From: dormando Date: Sun, 30 Aug 2020 17:20:06 -0700 Subject: 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. --- memcached.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'memcached.h') 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); -- cgit v1.2.1