Skip to content
Newer
Older
100644 328 lines (275 sloc) 12.2 KB
f6d334e @bradfitz 2003-06-10
bradfitz authored Jun 20, 2003
1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
1422dff @bradfitz fixup makefile, add Id lines
bradfitz authored Jun 11, 2003
2 /* $Id$ */
56b8339 Merge multithreaded into trunk, commit #2 (first commit only did the
Steven Grimm authored Apr 16, 2007
3 #include "config.h"
4 #include <sys/types.h>
5 #include <sys/time.h>
6 #include <netinet/in.h>
7 #include <event.h>
8
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
9 #define DATA_BUFFER_SIZE 2048
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
10 #define UDP_READ_BUFFER_SIZE 65536
11 #define UDP_MAX_PAYLOAD_SIZE 1400
12 #define UDP_HEADER_SIZE 8
13 #define MAX_SENDBUF_SIZE (256 * 1024 * 1024)
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
14
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
15 /* Initial size of list of items being returned by "get". */
16 #define ITEM_LIST_INITIAL 200
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
17
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
18 /* Initial size of the sendmsg() scatter/gather array. */
19 #define IOV_LIST_INITIAL 400
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
20
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
21 /* Initial number of sendmsg() argument structures to allocate. */
22 #define MSG_LIST_INITIAL 10
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
23
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
24 /* High water marks for buffer shrinking */
25 #define READ_BUFFER_HIGHWAT 8192
26 #define ITEM_LIST_HIGHWAT 400
27 #define IOV_LIST_HIGHWAT 600
28 #define MSG_LIST_HIGHWAT 100
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
29
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
30 /* Get a consistent bool type */
31 #if HAVE_STDBOOL_H
32 # include <stdbool.h>
33 #else
10862f6 * Remove unused parameter to item_size_ok()
Paul Lindner authored Mar 19, 2007
34 typedef enum {false = 0, true = 1} bool;
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
35 #endif
36
37 #if HAVE_STDINT_H
38 # include <stdint.h>
39 #else
40 typedef unsigned char uint8_t;
41 #endif
42
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
43 /* Time relative to server start. Smaller than time_t on 64-bit systems. */
44 typedef unsigned int rel_time_t;
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
45
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
46 struct stats {
47 unsigned int curr_items;
48 unsigned int total_items;
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
49 unsigned long long curr_bytes;
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
50 unsigned int curr_conns;
51 unsigned int total_conns;
52 unsigned int conn_structs;
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
53 unsigned long long get_cmds;
54 unsigned long long set_cmds;
55 unsigned long long get_hits;
56 unsigned long long get_misses;
3373cdf * Add patch to collect eviction statistics from
Jean-Francois BUSTARRET authored Mar 20, 2007
57 unsigned long long evictions;
6d74e13 @bradfitz -- remove the ages array since it's not needed. (you can just look
bradfitz authored Jun 1, 2003
58 time_t started; /* when the process was started */
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
59 unsigned long long bytes_read;
60 unsigned long long bytes_written;
61 };
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
62
eca55c9 Add patch for changable verbosity levels
Paul Lindner authored Apr 12, 2007
63 #define MAX_VERBOSITY_LEVEL 2
64
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
65 struct settings {
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
66 size_t maxbytes;
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
67 int maxconns;
68 int port;
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
69 int udpport;
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
70 struct in_addr interface;
71 int verbose;
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
72 rel_time_t oldest_live; /* ignore existing items older than this */
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
73 bool managed; /* if 1, a tracker manages virtual buckets */
841811e From: Jason Titus <jtitus@postini.com>
Jason Titus authored Feb 24, 2004
74 int evict_to_free;
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
75 char *socketpath; /* path to unix socket if using local socket */
76 double factor; /* chunk size growth factor */
77 int chunk_size;
56b8339 Merge multithreaded into trunk, commit #2 (first commit only did the
Steven Grimm authored Apr 16, 2007
78 int num_threads; /* number of libevent threads to run */
79 char prefix_delimiter; /* character that marks a key prefix (for stats) */
80 int detail_enabled; /* nonzero if we're collecting detailed stats */
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
81 };
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
82
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
83 extern struct stats stats;
84 extern struct settings settings;
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
85
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
86 #define ITEM_LINKED 1
87 #define ITEM_DELETED 2
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
88
54326f4 @bradfitz more debug
bradfitz authored Jun 27, 2003
89 /* temp */
90 #define ITEM_SLABBED 4
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
91
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
92 typedef struct _stritem {
93 struct _stritem *next;
94 struct _stritem *prev;
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
95 struct _stritem *h_next; /* hash chain next */
96 rel_time_t time; /* least recent access */
97 rel_time_t exptime; /* expire time */
98 int nbytes; /* size of data */
1ea89bd @bradfitz remove all trailing whitespace, not just first occurrence. :)
bradfitz authored Sep 4, 2006
99 unsigned short refcount;
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
100 uint8_t nsuffix; /* length of flags-and-length string */
101 uint8_t it_flags; /* ITEM_* above */
102 uint8_t slabs_clsid;/* which slab class we're in */
103 uint8_t nkey; /* key length, w/terminating null and padding */
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
104 void * end[0];
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
105 /* then null-terminated key */
106 /* then " flags length\r\n" (no terminating null) */
107 /* then data with terminating \r\n (no terminating null; it's binary!) */
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
108 } item;
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
109
f6d334e @bradfitz 2003-06-10
bradfitz authored Jun 20, 2003
110 #define ITEM_key(item) ((char*)&((item)->end[0]))
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
111
f6d334e @bradfitz 2003-06-10
bradfitz authored Jun 20, 2003
112 /* warning: don't use these macros with a function, as it evals its arg twice */
217dcce Incorporate changes from "performance" branch (revisions 414-419).
Steven Grimm authored Nov 26, 2006
113 #define ITEM_suffix(item) ((char*) &((item)->end[0]) + (item)->nkey + 1)
114 #define ITEM_data(item) ((char*) &((item)->end[0]) + (item)->nkey + 1 + (item)->nsuffix)
115 #define ITEM_ntotal(item) (sizeof(struct _stritem) + (item)->nkey + 1 + (item)->nsuffix + (item)->nbytes)
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
116
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
117 enum conn_states {
118 conn_listening, /* the socket which listens for connections */
119 conn_read, /* reading in a command line */
120 conn_write, /* writing out a simple response */
121 conn_nread, /* reading in a fixed number of bytes */
122 conn_swallow, /* swallowing unnecessary bytes w/o storing */
123 conn_closing, /* closing this connection */
124 conn_mwrite /* writing out many items sequentially */
125 };
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
126
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
127 #define NREAD_ADD 1
128 #define NREAD_SET 2
129 #define NREAD_REPLACE 3
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
130
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
131 typedef struct {
132 int sfd;
133 int state;
134 struct event event;
135 short ev_flags;
7a30802 avva's bucket/generation patch
Anatoly Vorobey authored Mar 5, 2006
136 short which; /* which events were just triggered */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
137
7a30802 avva's bucket/generation patch
Anatoly Vorobey authored Mar 5, 2006
138 char *rbuf; /* buffer to read commands into */
139 char *rcurr; /* but if we parsed some already, this is where we stopped */
140 int rsize; /* total allocated size of rbuf */
141 int rbytes; /* how much data, starting from rcur, do we have unparsed */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
142
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
143 char *wbuf;
144 char *wcurr;
145 int wsize;
1ea89bd @bradfitz remove all trailing whitespace, not just first occurrence. :)
bradfitz authored Sep 4, 2006
146 int wbytes;
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
147 int write_and_go; /* which state to go into after finishing current write */
148 void *write_and_free; /* free this memory after finishing writing */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
149
7a30802 avva's bucket/generation patch
Anatoly Vorobey authored Mar 5, 2006
150 char *ritem; /* when we read in an item's value, it goes here */
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
151 int rlbytes;
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
152
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
153 /* data for the nread state */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
154
1ea89bd @bradfitz remove all trailing whitespace, not just first occurrence. :)
bradfitz authored Sep 4, 2006
155 /*
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
156 * item is used to hold an item structure created after reading the command
1ea89bd @bradfitz remove all trailing whitespace, not just first occurrence. :)
bradfitz authored Sep 4, 2006
157 * line of set/add/replace commands, but before we finished reading the actual
7917af4 @bradfitz misc fixes as suggested by avva. lot of comment updates, mostly.
bradfitz authored Jun 22, 2003
158 * data. The data is read into ITEM_data(item) to avoid extra copying.
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
159 */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
160
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
161 void *item; /* for commands set/add/replace */
162 int item_comm; /* which one is it: set/add/replace */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
163
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
164 /* data for the swallow state */
165 int sbytes; /* how many bytes to swallow */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
166
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
167 /* data for the mwrite state */
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
168 struct iovec *iov;
169 int iovsize; /* number of elements allocated in iov[] */
170 int iovused; /* number of elements used in iov[] */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
171
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
172 struct msghdr *msglist;
173 int msgsize; /* number of elements allocated in msglist[] */
174 int msgused; /* number of elements used in msglist[] */
175 int msgcurr; /* element in msglist[] being transmitted now */
176 int msgbytes; /* number of bytes in current msg */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
177
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
178 item **ilist; /* list of items to write out */
179 int isize;
180 item **icurr;
181 int ileft;
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
182
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
183 /* data for UDP clients */
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
184 bool udp; /* is this is a UDP "connection" */
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
185 int request_id; /* Incoming UDP request ID, if this is a UDP "connection" */
186 struct sockaddr request_addr; /* Who sent the most recent request */
187 socklen_t request_addr_size;
188 unsigned char *hdrbuf; /* udp packet headers */
189 int hdrsize; /* number of headers' worth of space is allocated */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
190
1bb05fb @crucially r265@crucially-3: sky | 2006-03-29 17:02:15 +051800
crucially authored Mar 29, 2006
191 int binary; /* are we in binary mode */
7a30802 avva's bucket/generation patch
Anatoly Vorobey authored Mar 5, 2006
192 int bucket; /* bucket number for the next command, if running as
193 a managed instance. -1 (_not_ 0) means invalid. */
194 int gen; /* generation requested for the bucket */
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
195 } conn;
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
196
7a30802 avva's bucket/generation patch
Anatoly Vorobey authored Mar 5, 2006
197 /* number of virtual buckets for a managed instance */
198 #define MAX_BUCKETS 32768
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
199
c9607c6 @bradfitz merge end of facebook branch into trunk, after copying the old trunk …
bradfitz authored Sep 3, 2006
200 /* current time of day (updated periodically) */
201 extern volatile rel_time_t current_time;
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
202
8cb3381 @bradfitz more asserts
bradfitz authored Jun 27, 2003
203 /* temporary hack */
18a72ad @bradfitz version 1.1.6
bradfitz authored Jun 27, 2003
204 /* #define assert(x) if(!(x)) { printf("assert failure: %s\n", #x); pre_gdb(); }
205 void pre_gdb (); */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
206
60d7094 update from avva with new allocation policy: bunches of power-of-two
Anatoly Vorobey authored May 30, 2003
207 /*
208 * Functions
209 */
86969ea @bradfitz restore blank lines I over-zealously destroyed earlier.
bradfitz authored Sep 4, 2006
210
56b8339 Merge multithreaded into trunk, commit #2 (first commit only did the
Steven Grimm authored Apr 16, 2007
211 conn *do_conn_from_freelist();
212 int do_conn_add_to_freelist(conn *c);
213 char *do_defer_delete(item *item, time_t exptime);
214 void do_run_deferred_deletes(void);
215 char *do_add_delta(item *item, int incr, unsigned int delta, char *buf);
216 int do_store_item(item *item, int comm);
217 conn *conn_new(const int sfd, const int init_state, const int event_flags, const int read_buffer_size, const bool is_udp, struct event_base *base);
218
219
220 #include "stats.h"
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
221 #include "slabs.h"
222 #include "assoc.h"
223 #include "items.h"
56b8339 Merge multithreaded into trunk, commit #2 (first commit only did the
Steven Grimm authored Apr 16, 2007
224
225
226 /*
227 * In multithreaded mode, we wrap certain functions with lock management and
228 * replace the logic of some other functions. All wrapped functions have
229 * "mt_" and "do_" variants. In multithreaded mode, the plain version of a
230 * function is #define-d to the "mt_" variant, which often just grabs a
231 * lock and calls the "do_" function. In singlethreaded mode, the "do_"
232 * function is called directly.
233 *
234 * Functions such as the libevent-related calls that need to do cross-thread
235 * communication in multithreaded mode (rather than actually doing the work
236 * in the current thread) are called via "dispatch_" frontends, which are
237 * also #define-d to directly call the underlying code in singlethreaded mode.
238 */
239 #ifdef USE_THREADS
240
241 void thread_init(int nthreads, struct event_base *main_base);
242 int dispatch_event_add(int thread, conn *c);
243 void dispatch_conn_new(int sfd, int init_state, int event_flags, int read_buffer_size, int is_udp);
244
245 /* Lock wrappers for cache functions that are called from main loop. */
246 char *mt_add_delta(item *item, int incr, unsigned int delta, char *buf);
247 conn *mt_conn_from_freelist(void);
248 int mt_conn_add_to_freelist(conn *c);
249 char *mt_defer_delete(item *it, time_t exptime);
250 int mt_is_listen_thread(void);
251 item *mt_item_alloc(char *key, size_t nkey, int flags, rel_time_t exptime, int nbytes);
252 void mt_item_flush_expired(void);
253 item *mt_item_get_notedeleted(char *key, size_t nkey, int *delete_locked);
254 item *mt_item_get_nocheck(char *key, size_t nkey);
255 int mt_item_link(item *it);
256 void mt_item_remove(item *it);
257 int mt_item_replace(item *it, item *new_it);
258 void mt_item_unlink(item *it);
259 void mt_item_update(item *it);
260 void mt_run_deferred_deletes(void);
261 void *mt_slabs_alloc(size_t size);
262 void mt_slabs_free(void *ptr, size_t size);
263 int mt_slabs_reassign(unsigned char srcid, unsigned char dstid);
264 char *mt_slabs_stats(int *buflen);
265 void mt_stats_lock(void);
266 void mt_stats_unlock(void);
267 int mt_store_item(item *item, int comm);
268
269
270 # define add_delta(x,y,z,a) mt_add_delta(x,y,z,a)
271 # define assoc_move_next_bucket() mt_assoc_move_next_bucket()
272 # define conn_from_freelist() mt_conn_from_freelist()
273 # define conn_add_to_freelist(x) mt_conn_add_to_freelist(x)
274 # define defer_delete(x,y) mt_defer_delete(x,y)
275 # define is_listen_thread() mt_is_listen_thread()
276 # define item_alloc(x,y,z,a,b) mt_item_alloc(x,y,z,a,b)
277 # define item_flush_expired() mt_item_flush_expired()
278 # define item_get_nocheck(x,y) mt_item_get_nocheck(x,y)
279 # define item_get_notedeleted(x,y,z) mt_item_get_notedeleted(x,y,z)
280 # define item_link(x) mt_item_link(x)
281 # define item_remove(x) mt_item_remove(x)
282 # define item_replace(x,y) mt_item_replace(x,y)
283 # define item_update(x) mt_item_update(x)
284 # define item_unlink(x) mt_item_unlink(x)
285 # define run_deferred_deletes() mt_run_deferred_deletes()
286 # define slabs_alloc(x) mt_slabs_alloc(x)
287 # define slabs_free(x,y) mt_slabs_free(x,y)
288 # define slabs_reassign(x,y) mt_slabs_reassign(x,y)
289 # define slabs_stats(x) mt_slabs_stats(x)
290 # define store_item(x,y) mt_store_item(x,y)
291
292 # define STATS_LOCK() mt_stats_lock()
293 # define STATS_UNLOCK() mt_stats_unlock()
294
295 #else /* !USE_THREADS */
296
297 # define add_delta(x,y,z,a) do_add_delta(x,y,z,a)
298 # define assoc_move_next_bucket() do_assoc_move_next_bucket()
299 # define conn_from_freelist() do_conn_from_freelist()
300 # define conn_add_to_freelist(x) do_conn_add_to_freelist(x)
301 # define defer_delete(x,y) do_defer_delete(x,y)
302 # define dispatch_conn_new(x,y,z,a,b) conn_new(x,y,z,a,b,main_base)
303 # define dispatch_event_add(t,c) event_add(&(c)->event, 0)
304 # define is_listen_thread() 1
305 # define item_alloc(x,y,z,a,b) do_item_alloc(x,y,z,a,b)
306 # define item_flush_expired() do_item_flush_expired()
307 # define item_get_nocheck(x,y) do_item_get_nocheck(x,y)
308 # define item_get_notedeleted(x,y,z) do_item_get_notedeleted(x,y,z)
309 # define item_link(x) do_item_link(x)
310 # define item_remove(x) do_item_remove(x)
311 # define item_replace(x,y) do_item_replace(x,y)
312 # define item_unlink(x) do_item_unlink(x)
313 # define item_update(x) do_item_update(x)
314 # define run_deferred_deletes() do_run_deferred_deletes()
315 # define slabs_alloc(x) do_slabs_alloc(x)
316 # define slabs_free(x,y) do_slabs_free(x,y)
317 # define slabs_reassign(x,y) do_slabs_reassign(x,y)
318 # define slabs_stats(x) do_slabs_stats(x)
319 # define store_item(x,y) do_store_item(x,y)
320 # define thread_init(x,y) 0
321
322 # define STATS_LOCK() /**/
323 # define STATS_UNLOCK() /**/
324
325 #endif /* !USE_THREADS */
326
327
Something went wrong with that request. Please try again.