]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Extend the number and size of String MemPools
authorFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 6 Apr 2011 22:45:40 +0000 (00:45 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 6 Apr 2011 22:45:40 +0000 (00:45 +0200)
Define and enable 512-bytes, 1kb, 4kb and 16kb mempooled strings
to cover expected upcoming uses

src/mem.cc

index 9a0c1cb44283989e539dafd731da617aaa2ffc41..d0e336b57f51a13be00a8ee243460b069bf81928 100644 (file)
@@ -65,11 +65,11 @@ static double xm_deltat = 0;
 static bool MemIsInitialized = false;
 
 /* string pools */
-#define mem_str_pool_count 3
+#define mem_str_pool_count 6
 
 // 4 bytes bigger than the biggest string pool size
 // which is in turn calculated from SmallestStringBeforeMemIsInitialized
-static const size_t SmallestStringBeforeMemIsInitialized = 516;
+static const size_t SmallestStringBeforeMemIsInitialized = 1024*16+4;
 
 static const struct {
     const char *name;
@@ -85,9 +85,18 @@ StrPoolsAttrs[mem_str_pool_count] = {
         "Medium Strings", MemAllocator::RoundedSize(128),
     },                         /* to fit most urls */
     {
-        "Long Strings", 
+        "Long Strings", MemAllocator::RoundedSize(512),
+    },
+    {
+        "1KB Strings", MemAllocator::RoundedSize(1024),
+    },
+    {
+        "4KB Strings", MemAllocator::RoundedSize(4*1024),
+    },
+    {
+        "16KB Strings",
         MemAllocator::RoundedSize(SmallestStringBeforeMemIsInitialized-4)
-    }                          /* other */
+    }
 };
 
 static struct {