xref: /memcached-1.4.29/globals.c (revision cb01d504)
1420aa2d9SBrad Fitzpatrick #include "memcached.h"
2420aa2d9SBrad Fitzpatrick 
3420aa2d9SBrad Fitzpatrick /*
4420aa2d9SBrad Fitzpatrick  * This file contains global variables shared across the rest of the
5420aa2d9SBrad Fitzpatrick  * memcached codebase.  These were originally in memcached.c but had
6420aa2d9SBrad Fitzpatrick  * to be removed to make the rest of the object files linkable into
7420aa2d9SBrad Fitzpatrick  * the test infrastructure.
8420aa2d9SBrad Fitzpatrick  *
9420aa2d9SBrad Fitzpatrick  */
10420aa2d9SBrad Fitzpatrick 
11420aa2d9SBrad Fitzpatrick /*
12420aa2d9SBrad Fitzpatrick  * We keep the current time of day in a global variable that's updated by a
13420aa2d9SBrad Fitzpatrick  * timer event. This saves us a bunch of time() system calls (we really only
14420aa2d9SBrad Fitzpatrick  * need to get the time once a second, whereas there can be tens of thousands
15420aa2d9SBrad Fitzpatrick  * of requests a second) and allows us to use server-start-relative timestamps
16420aa2d9SBrad Fitzpatrick  * rather than absolute UNIX timestamps, a space savings on systems where
17420aa2d9SBrad Fitzpatrick  * sizeof(time_t) > sizeof(unsigned int).
18420aa2d9SBrad Fitzpatrick  */
19420aa2d9SBrad Fitzpatrick volatile rel_time_t current_time;
20420aa2d9SBrad Fitzpatrick 
21420aa2d9SBrad Fitzpatrick /** exported globals **/
22420aa2d9SBrad Fitzpatrick struct stats stats;
23*cb01d504Sdormando struct stats_state stats_state;
24420aa2d9SBrad Fitzpatrick struct settings settings;
2510698baeSdormando struct slab_rebalance slab_rebal;
2610698baeSdormando volatile int slab_rebalance_signal;
27