/*
- * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
/* DEBUG: section 13 High Level Memory Pool Management */
#include "squid.h"
-#include "acl/AclDenyInfoList.h"
-#include "acl/AclNameList.h"
#include "base/PackableStream.h"
#include "ClientInfo.h"
#include "dlink.h"
#include "MemBuf.h"
#include "mgr/Registration.h"
#include "SquidConfig.h"
-#include "SquidList.h"
#include "SquidTime.h"
#include "Store.h"
static Mem::Meter HugeBufVolumeMeter;
/* local routines */
+
+// XXX: refactor objects using these pools to use MEMPROXY classes instead
+// then remove this function entirely
static MemAllocator *&
GetPool(size_t type)
{
MemPools::GetInstance().setIdleLimit(new_pool_limit);
}
-/* XXX make these classes do their own memory management */
-#include "HttpHdrContRange.h"
-
void
Mem::Init(void)
{
memDataInit(MEM_16K_BUF, "16K Buffer", 16384, 10, false);
memDataInit(MEM_32K_BUF, "32K Buffer", 32768, 10, false);
memDataInit(MEM_64K_BUF, "64K Buffer", 65536, 10, false);
- memDataInit(MEM_ACL_DENY_INFO_LIST, "AclDenyInfoList",
- sizeof(AclDenyInfoList), 0);
- memDataInit(MEM_ACL_NAME_LIST, "acl_name_list", sizeof(AclNameList), 0);
- memDataInit(MEM_LINK_LIST, "link_list", sizeof(link_list), 10);
- memDataInit(MEM_DLINK_NODE, "dlink_node", sizeof(dlink_node), 10);
memDataInit(MEM_DREAD_CTRL, "dread_ctrl", sizeof(dread_ctrl), 0);
memDataInit(MEM_DWRITE_Q, "dwrite_q", sizeof(dwrite_q), 0);
- memDataInit(MEM_HTTP_HDR_CONTENT_RANGE, "HttpHdrContRange", sizeof(HttpHdrContRange), 0);
- memDataInit(MEM_NETDBENTRY, "netdbEntry", sizeof(netdbEntry), 0);
- memDataInit(MEM_NET_DB_NAME, "net_db_name", sizeof(net_db_name), 0);
- memDataInit(MEM_CLIENT_INFO, "ClientInfo", sizeof(ClientInfo), 0);
memDataInit(MEM_MD5_DIGEST, "MD5 digest", SQUID_MD5_DIGEST_LENGTH, 0);
GetPool(MEM_MD5_DIGEST)->setChunkSize(512 * 1024);
{
mem_type t = MEM_NONE;
- while (++t < MEM_DONTFREE) {
+ while (++t < MEM_MAX) {
/*
* If you hit this assertion, then you forgot to add a
* memDataInit() line for type 't'.
- * Or placed the pool type in the wrong section of the enum list.
*/
assert(GetPool(t));
}