summaryrefslogtreecommitdiff
path: root/globals.c
diff options
context:
space:
mode:
authorBrad Fitzpatrick <brad@danga.com>2008-10-14 21:03:05 -0700
committerDustin Sallings <dustin@spy.net>2009-03-19 01:52:53 -0700
commit420aa2d992093b78c1bba6cbb3577d5b53a19ec8 (patch)
treeb465c4262e27303f5178350f1a7d8239b864c1eb /globals.c
parent9791d32edaa99d2cb3825c2e526b066a6cbe2e4c (diff)
downloadmemcached-420aa2d992093b78c1bba6cbb3577d5b53a19ec8.tar.gz
start of the incr fix, rearranges a bunch, adds util, tests, etc
Diffstat (limited to 'globals.c')
-rw-r--r--globals.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/globals.c b/globals.c
new file mode 100644
index 0000000..7d7b2a3
--- /dev/null
+++ b/globals.c
@@ -0,0 +1,23 @@
+#include "memcached.h"
+
+/*
+ * This file contains global variables shared across the rest of the
+ * memcached codebase. These were originally in memcached.c but had
+ * to be removed to make the rest of the object files linkable into
+ * the test infrastructure.
+ *
+ */
+
+/*
+ * We keep the current time of day in a global variable that's updated by a
+ * timer event. This saves us a bunch of time() system calls (we really only
+ * need to get the time once a second, whereas there can be tens of thousands
+ * of requests a second) and allows us to use server-start-relative timestamps
+ * rather than absolute UNIX timestamps, a space savings on systems where
+ * sizeof(time_t) > sizeof(unsigned int).
+ */
+volatile rel_time_t current_time;
+
+/** exported globals **/
+struct stats stats;
+struct settings settings;