#include "squid.h"
#include "base/PackableStream.h"
#include "ClientInfo.h"
#include "dlink.h"
#include "event.h"
#include "fs_io.h"
#include "icmp/net_db.h"
#include "md5.h"
#include "mem/Allocator.h"
#include "mem/Pool.h"
#include "mem/Stats.h"
#include "MemBuf.h"
#include "mgr/Registration.h"
#include "SquidConfig.h"
#include "Store.h"
#include <iomanip>
Go to the source code of this file.
Classes | |
struct | PoolMeta |
Macros | |
#define | mem_str_pool_count 6 |
Functions | |
static void | memFree2K (void *) |
static void | memFree4K (void *) |
static void | memFree8K (void *) |
static void | memFree16K (void *) |
static void | memFree32K (void *) |
static void | memFree64K (void *) |
static void | memStringStats (std::ostream &) |
static Mem::Allocator *& | GetPool (size_t type) |
static Mem::Allocator & | GetStrPool (size_t type) |
static Mem::Allocator * | memFindStringPool (size_t net_size, bool fuzzy) |
static void | memBufStats (std::ostream &stream) |
void | memDataInit (mem_type type, const char *name, size_t size, int, bool doZero) |
void * | memAllocate (mem_type type) |
Allocate one element from the typed pool. More... | |
void | memFree (void *p, int type) |
Free a element allocated by memAllocate() More... | |
void * | memAllocString (size_t net_size, size_t *gross_size) |
void * | memAllocRigid (size_t net_size) |
size_t | memStringCount () |
void | memFreeString (size_t size, void *buf) |
void | memFreeRigid (void *buf, size_t net_size) |
static mem_type | memFindBufSizeType (size_t net_size, size_t *gross_size) |
void * | memAllocBuf (size_t net_size, size_t *gross_size) |
void * | memReallocBuf (void *oldbuf, size_t net_size, size_t *gross_size) |
void | memFreeBuf (size_t size, void *buf) |
void | memConfigure (void) |
static mem_type & | operator++ (mem_type &aMem) |
void | memCheckInit (void) |
void | memClean (void) |
Main cleanup handler. More... | |
int | memInUse (mem_type type) |
static void | cxx_xfree (void *ptr) |
FREE * | memFreeBufFunc (size_t size) |
Variables | |
static double | xm_time = 0 |
static double | xm_deltat = 0 |
static Mem::Meter | StrCountMeter |
static Mem::Meter | StrVolumeMeter |
static Mem::Meter | HugeBufCountMeter |
static Mem::Meter | HugeBufVolumeMeter |
static double | clean_interval = 15.0 |
Macro Definition Documentation
◆ mem_str_pool_count
#define mem_str_pool_count 6 |
Definition at line 45 of file old_api.cc.
Function Documentation
◆ cxx_xfree()
|
static |
◆ GetPool()
|
static |
Definition at line 63 of file old_api.cc.
References MEM_MAX.
Referenced by Mem::Init(), memAllocate(), memCheckInit(), memDataInit(), memFree(), and memInUse().
◆ GetStrPool()
|
static |
Lastly init the string pools.
Definition at line 80 of file old_api.cc.
References DBG_IMPORTANT, debugs, mem_str_pool_count, memPoolCreate, Mem::Allocator::RoundedSize(), and Mem::Allocator::zeroBlocks().
Referenced by memFindStringPool(), memStringCount(), and memStringStats().
◆ memAllocate()
void * memAllocate | ( | mem_type | type | ) |
Definition at line 213 of file old_api.cc.
References Mem::Allocator::alloc(), assert, and GetPool().
Referenced by diskCombineWrites(), file_read(), file_write(), memAllocBuf(), netdbBinaryExchange(), Ftp::Gateway::parseListing(), and storeKeyDup().
◆ memAllocBuf()
Definition at line 344 of file old_api.cc.
References HugeBufCountMeter, HugeBufVolumeMeter, MEM_NONE, memAllocate(), memFindBufSizeType(), and xcalloc().
Referenced by memReallocBuf().
◆ memAllocRigid()
void * memAllocRigid | ( | size_t | net_size | ) |
Definition at line 248 of file old_api.cc.
References memFindStringPool(), StrCountMeter, StrVolumeMeter, and xmalloc.
◆ memAllocString()
Definition at line 229 of file old_api.cc.
References assert, memFindStringPool(), StrCountMeter, StrVolumeMeter, and xcalloc().
◆ memBufStats()
|
static |
Definition at line 157 of file old_api.cc.
References Mem::Meter::currentLevel(), HugeBufCountMeter, and HugeBufVolumeMeter.
Referenced by Mem::Stats().
◆ memCheckInit()
void memCheckInit | ( | void | ) |
Definition at line 471 of file old_api.cc.
References assert, GetPool(), MEM_MAX, and MEM_NONE.
Referenced by mainInitialize().
◆ memClean()
void memClean | ( | void | ) |
Definition at line 485 of file old_api.cc.
References MemPools::clean(), Config, debugs, MemPools::GetInstance(), Mem::GlobalStats(), SquidConfig::limit, SquidConfig::MemPools, MemPools::setIdleLimit(), and Ping::stats.
Referenced by SquidShutdown().
◆ memConfigure()
void memConfigure | ( | void | ) |
Set to configured value first
Definition at line 406 of file old_api.cc.
References Config, DBG_IMPORTANT, debugs, MemPools::GetInstance(), SquidConfig::limit, SquidConfig::mem_pools, SquidConfig::MemPools, SquidConfig::onoff, and MemPools::setIdleLimit().
Referenced by configDoConfigure().
◆ memDataInit()
Definition at line 200 of file old_api.cc.
References assert, GetPool(), memPoolCreate, size, and Mem::Allocator::zeroBlocks().
Referenced by Mem::Init().
◆ memFindBufSizeType()
Definition at line 308 of file old_api.cc.
References MEM_16K_BUF, MEM_2K_BUF, MEM_32K_BUF, MEM_4K_BUF, MEM_64K_BUF, MEM_8K_BUF, MEM_NONE, and size.
Referenced by memAllocBuf(), and memFreeBuf().
◆ memFindStringPool()
|
static |
- Returns
- the best-fit string pool or nil
Definition at line 117 of file old_api.cc.
References GetStrPool(), and mem_str_pool_count.
Referenced by memAllocRigid(), memAllocString(), memFreeRigid(), and memFreeString().
◆ memFree()
void memFree | ( | void * | p, |
int | type | ||
) |
Definition at line 221 of file old_api.cc.
References assert, Mem::Allocator::freeOne(), and GetPool().
Referenced by memFree16K(), memFree2K(), memFree32K(), memFree4K(), memFree64K(), memFree8K(), and memFreeBuf().
◆ memFree16K()
|
static |
Definition at line 527 of file old_api.cc.
References MEM_16K_BUF, and memFree().
Referenced by memFreeBufFunc().
◆ memFree2K()
|
static |
Definition at line 509 of file old_api.cc.
References MEM_2K_BUF, and memFree().
Referenced by memFreeBufFunc().
◆ memFree32K()
|
static |
Definition at line 533 of file old_api.cc.
References MEM_32K_BUF, and memFree().
Referenced by memFreeBufFunc().
◆ memFree4K()
|
static |
Definition at line 515 of file old_api.cc.
References MEM_4K_BUF, and memFree().
Referenced by memFreeBufFunc().
◆ memFree64K()
|
static |
Definition at line 539 of file old_api.cc.
References MEM_64K_BUF, and memFree().
Referenced by memFreeBufFunc().
◆ memFree8K()
|
static |
Definition at line 521 of file old_api.cc.
References MEM_8K_BUF, and memFree().
Referenced by memFreeBufFunc().
◆ memFreeBuf()
void memFreeBuf | ( | size_t | size, |
void * | buf | ||
) |
Definition at line 383 of file old_api.cc.
References HugeBufCountMeter, HugeBufVolumeMeter, MEM_NONE, memFindBufSizeType(), memFree(), size, and xfree.
Referenced by memReallocBuf().
◆ memFreeBufFunc()
Definition at line 551 of file old_api.cc.
References cxx_xfree(), HugeBufCountMeter, HugeBufVolumeMeter, memFree16K(), memFree2K(), memFree32K(), memFree4K(), memFree64K(), memFree8K(), and size.
◆ memFreeRigid()
void memFreeRigid | ( | void * | buf, |
size_t | net_size | ||
) |
Definition at line 290 of file old_api.cc.
References memFindStringPool(), StrCountMeter, StrVolumeMeter, and xfree.
◆ memFreeString()
void memFreeString | ( | size_t | size, |
void * | buf | ||
) |
Definition at line 276 of file old_api.cc.
References assert, memFindStringPool(), size, StrCountMeter, StrVolumeMeter, and xfree.
◆ memInUse()
Definition at line 501 of file old_api.cc.
◆ memReallocBuf()
Definition at line 359 of file old_api.cc.
References memAllocBuf(), and memFreeBuf().
◆ memStringCount()
size_t memStringCount | ( | ) |
Definition at line 264 of file old_api.cc.
References Mem::Allocator::getInUseCount(), GetStrPool(), and mem_str_pool_count.
◆ memStringStats()
|
static |
Definition at line 130 of file old_api.cc.
References Mem::Meter::currentLevel(), GetStrPool(), mem_str_pool_count, StrCountMeter, StrVolumeMeter, and xpercentInt().
Referenced by Mem::Stats().
◆ operator++()
Definition at line 460 of file old_api.cc.
References int.
Variable Documentation
◆ clean_interval
|
static |
Definition at line 396 of file old_api.cc.
Referenced by Mem::CleanIdlePools().
◆ HugeBufCountMeter
|
static |
Definition at line 55 of file old_api.cc.
Referenced by memAllocBuf(), memBufStats(), memFreeBuf(), and memFreeBufFunc().
◆ HugeBufVolumeMeter
|
static |
Definition at line 56 of file old_api.cc.
Referenced by memAllocBuf(), memBufStats(), memFreeBuf(), and memFreeBufFunc().
◆ StrCountMeter
|
static |
Definition at line 52 of file old_api.cc.
Referenced by memAllocRigid(), memAllocString(), memFreeRigid(), memFreeString(), and memStringStats().
◆ StrVolumeMeter
|
static |
Definition at line 53 of file old_api.cc.
Referenced by memAllocRigid(), memAllocString(), memFreeRigid(), memFreeString(), and memStringStats().
◆ xm_deltat
|
static |
Definition at line 42 of file old_api.cc.
Referenced by DumpMallocStatistics(), Mem::PoolReport(), and Mem::Report().
◆ xm_time
|
static |
Definition at line 41 of file old_api.cc.
Referenced by DumpMallocStatistics(), and Mem::Report().