[memcached] sgrimm, r427: Multithreading prep: move some common in...

commits at code.sixapart.com commits at code.sixapart.com
Thu Nov 9 23:13:16 UTC 2006


Multithreading prep: move some common include files into memcached.h, and
include memcached.h rather than those files in all the C sources.


U   branches/multithreaded/server/assoc.c
U   branches/multithreaded/server/items.c
U   branches/multithreaded/server/memcached.c
U   branches/multithreaded/server/memcached.h
U   branches/multithreaded/server/slabs.c


Modified: branches/multithreaded/server/assoc.c
===================================================================
--- branches/multithreaded/server/assoc.c	2006-11-09 22:40:13 UTC (rev 426)
+++ branches/multithreaded/server/assoc.c	2006-11-09 23:13:15 UTC (rev 427)
@@ -12,10 +12,8 @@
  *
  * $Id$
  */
-#include "config.h"
-#include <sys/types.h>
+#include "memcached.h"
 #include <sys/stat.h>
-#include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/signal.h>
 #include <sys/resource.h>
@@ -24,13 +22,9 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
-#include <netinet/in.h>
 #include <errno.h>
-#include <event.h>
 #include <assert.h>
 
-#include "memcached.h"
-
 /*
  * Since the hash function does bit manipulation, it needs to know
  * whether it's big or little-endian. ENDIAN_LITTLE and ENDIAN_BIG

Modified: branches/multithreaded/server/items.c
===================================================================
--- branches/multithreaded/server/items.c	2006-11-09 22:40:13 UTC (rev 426)
+++ branches/multithreaded/server/items.c	2006-11-09 23:13:15 UTC (rev 427)
@@ -1,8 +1,7 @@
 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
 /* $Id$ */
-#include <sys/types.h>
+#include "memcached.h"
 #include <sys/stat.h>
-#include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/signal.h>
 #include <sys/resource.h>
@@ -11,14 +10,10 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
-#include <netinet/in.h>
 #include <errno.h>
 #include <time.h>
-#include <event.h>
 #include <assert.h>
 
-#include "memcached.h"
-
 /*
  * We only reposition items in the LRU queue if they haven't been repositioned
  * in this many seconds. That saves us from churning on frequently-accessed

Modified: branches/multithreaded/server/memcached.c
===================================================================
--- branches/multithreaded/server/memcached.c	2006-11-09 22:40:13 UTC (rev 426)
+++ branches/multithreaded/server/memcached.c	2006-11-09 23:13:15 UTC (rev 427)
@@ -15,10 +15,8 @@
  *
  *  $Id$
  */
-#include "config.h"
-#include <sys/types.h>
+#include "memcached.h"
 #include <sys/stat.h>
-#include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/signal.h>
@@ -41,12 +39,10 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
-#include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <arpa/inet.h>
 #include <errno.h>
 #include <time.h>
-#include <event.h>
 #include <assert.h>
 #include <limits.h>
 
@@ -61,8 +57,6 @@
 #endif
 #endif
 
-#include "memcached.h"
-
 struct stats stats;
 struct settings settings;
 

Modified: branches/multithreaded/server/memcached.h
===================================================================
--- branches/multithreaded/server/memcached.h	2006-11-09 22:40:13 UTC (rev 426)
+++ branches/multithreaded/server/memcached.h	2006-11-09 23:13:15 UTC (rev 427)
@@ -1,5 +1,11 @@
 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
 /* $Id$ */
+#include "config.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <netinet/in.h>
+#include <event.h>
+
 #define DATA_BUFFER_SIZE 2048
 #define UDP_READ_BUFFER_SIZE 65536
 #define UDP_MAX_PAYLOAD_SIZE 1400

Modified: branches/multithreaded/server/slabs.c
===================================================================
--- branches/multithreaded/server/slabs.c	2006-11-09 22:40:13 UTC (rev 426)
+++ branches/multithreaded/server/slabs.c	2006-11-09 23:13:15 UTC (rev 427)
@@ -9,9 +9,8 @@
  *
  * $Id$
  */
-#include <sys/types.h>
+#include "memcached.h"
 #include <sys/stat.h>
-#include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/signal.h>
 #include <sys/resource.h>
@@ -20,13 +19,9 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
-#include <netinet/in.h>
 #include <errno.h>
-#include <event.h>
 #include <assert.h>
 
-#include "memcached.h"
-
 #define POWER_SMALLEST 1
 #define POWER_LARGEST  200
 #define POWER_BLOCK 1048576




More information about the memcached-commits mailing list