summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2009-03-06 16:48:56 -0800
committerDustin Sallings <dustin@spy.net>2009-03-06 18:36:16 -0800
commit7173856af5532b7dfccefe38fca16f7e3ea94a89 (patch)
tree5a1e9b094861e991b69e311c7d8e3138c0ae9214
parent067102a49c6ef2bb14b25d192a58c8babe84a642 (diff)
downloadmemcached-7173856af5532b7dfccefe38fca16f7e3ea94a89.tar.gz
Create a more sensible definition for the maximum number of slab classes.
-rw-r--r--memcached.h1
-rw-r--r--slabs.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/memcached.h b/memcached.h
index a31713c..5d521bf 100644
--- a/memcached.h
+++ b/memcached.h
@@ -61,6 +61,7 @@
#define POWER_BLOCK 1048576
#define CHUNK_ALIGN_BYTES 8
#define DONT_PREALLOC_SLABS
+#define MAX_NUMBER_OF_SLAB_CLASSES (POWER_LARGEST + 1)
/** Time relative to server start. Smaller than time_t on 64-bit systems. */
typedef unsigned int rel_time_t;
diff --git a/slabs.c b/slabs.c
index 9141fc5..8d57f44 100644
--- a/slabs.c
+++ b/slabs.c
@@ -42,7 +42,7 @@ typedef struct {
unsigned int killing; /* index+1 of dying slab, or zero if none */
} slabclass_t;
-static slabclass_t slabclass[POWER_LARGEST + 1];
+static slabclass_t slabclass[MAX_NUMBER_OF_SLAB_CLASSES];
static size_t mem_limit = 0;
static size_t mem_malloced = 0;
static int power_largest;