From: Amos Jeffries Date: Thu, 24 Mar 2016 09:18:33 +0000 (+1300) Subject: Remove useless SmallestStringBeforeMemIsInitialized X-Git-Tag: SQUID_4_0_8~20^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9dbe98b9c51da9c7529637faf7d2cbb27e3d8ae4;p=thirdparty%2Fsquid.git Remove useless SmallestStringBeforeMemIsInitialized --- diff --git a/src/mem/old_api.cc b/src/mem/old_api.cc index d0e8fc11a8..b9d28b5db8 100644 --- a/src/mem/old_api.cc +++ b/src/mem/old_api.cc @@ -52,10 +52,6 @@ static bool MemIsInitialized = false; /* string pools */ #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 = 1024*16+4; - struct PoolMeta { const char *name; size_t obj_size; @@ -94,7 +90,7 @@ GetStrPool(size_t type) {"Long Strings", MemAllocator::RoundedSize(512)}, {"1KB Strings", MemAllocator::RoundedSize(1024)}, {"4KB Strings", MemAllocator::RoundedSize(4*1024)}, - {"16KB Strings", MemAllocator::RoundedSize(SmallestStringBeforeMemIsInitialized-4)} + {"16KB Strings", MemAllocator::RoundedSize(16*1024)} }; if (!initialized) { @@ -244,12 +240,6 @@ memAllocString(size_t net_size, size_t * gross_size) MemAllocator *pool = NULL; assert(gross_size); - // if pools are not yet ready, make sure that - // the requested size is not poolable so that the right deallocator - // will be used - if (!MemIsInitialized && net_size < SmallestStringBeforeMemIsInitialized) - net_size = SmallestStringBeforeMemIsInitialized; - auto type = memFindStringSizeType(net_size, true); if (type != MEM_NONE) pool = GetStrPool(type);