From: Francesco Chemolli Date: Wed, 6 Apr 2011 22:45:40 +0000 (+0200) Subject: Extend the number and size of String MemPools X-Git-Tag: take06~27^2~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=867c718de07016926069a77c1a9267e6a074e445;p=thirdparty%2Fsquid.git Extend the number and size of String MemPools Define and enable 512-bytes, 1kb, 4kb and 16kb mempooled strings to cover expected upcoming uses --- diff --git a/src/mem.cc b/src/mem.cc index 9a0c1cb442..d0e336b57f 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -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 {