xref: /memcached-1.4.29/globals.c (revision cb01d504)
1 #include "memcached.h"
2 
3 /*
4  * This file contains global variables shared across the rest of the
5  * memcached codebase.  These were originally in memcached.c but had
6  * to be removed to make the rest of the object files linkable into
7  * the test infrastructure.
8  *
9  */
10 
11 /*
12  * We keep the current time of day in a global variable that's updated by a
13  * timer event. This saves us a bunch of time() system calls (we really only
14  * need to get the time once a second, whereas there can be tens of thousands
15  * of requests a second) and allows us to use server-start-relative timestamps
16  * rather than absolute UNIX timestamps, a space savings on systems where
17  * sizeof(time_t) > sizeof(unsigned int).
18  */
19 volatile rel_time_t current_time;
20 
21 /** exported globals **/
22 struct stats stats;
23 struct stats_state stats_state;
24 struct settings settings;
25 struct slab_rebalance slab_rebal;
26 volatile int slab_rebalance_signal;
27