old_api.cc File Reference
#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>
Include dependency graph for old_api.cc:

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::AllocatorGetStrPool (size_t type)
 
static Mem::AllocatormemFindStringPool (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_typeoperator++ (mem_type &aMem)
 
void memCheckInit (void)
 
void memClean (void)
 Main cleanup handler. More...
 
int memInUse (mem_type type)
 
static void cxx_xfree (void *ptr)
 
FREEmemFreeBufFunc (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 void cxx_xfree ( void *  ptr)
static

Definition at line 545 of file old_api.cc.

References xfree.

Referenced by memFreeBufFunc().

◆ GetPool()

static Mem::Allocator *& GetPool ( size_t  type)
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 Mem::Allocator & GetStrPool ( size_t  type)
static

◆ memAllocate()

◆ memAllocBuf()

void * memAllocBuf ( size_t  net_size,
size_t gross_size 
)

◆ memAllocRigid()

void * memAllocRigid ( size_t  net_size)

Definition at line 248 of file old_api.cc.

References memFindStringPool(), StrCountMeter, StrVolumeMeter, and xmalloc.

◆ memAllocString()

void * memAllocString ( size_t  net_size,
size_t gross_size 
)

Definition at line 229 of file old_api.cc.

References assert, memFindStringPool(), StrCountMeter, StrVolumeMeter, and xcalloc().

◆ memBufStats()

static void memBufStats ( std::ostream &  stream)
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()

◆ memConfigure()

void memConfigure ( void  )

◆ memDataInit()

void memDataInit ( mem_type  type,
const char *  name,
size_t  size,
int  ,
bool  doZero 
)

Definition at line 200 of file old_api.cc.

References assert, GetPool(), memPoolCreate, size, and Mem::Allocator::zeroBlocks().

Referenced by Mem::Init().

◆ memFindBufSizeType()

static mem_type memFindBufSizeType ( size_t  net_size,
size_t gross_size 
)
static

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 Mem::Allocator * memFindStringPool ( size_t  net_size,
bool  fuzzy 
)
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 
)

◆ memFree16K()

void memFree16K ( void *  p)
static

Definition at line 527 of file old_api.cc.

References MEM_16K_BUF, and memFree().

Referenced by memFreeBufFunc().

◆ memFree2K()

void memFree2K ( void *  p)
static

Definition at line 509 of file old_api.cc.

References MEM_2K_BUF, and memFree().

Referenced by memFreeBufFunc().

◆ memFree32K()

void memFree32K ( void *  p)
static

Definition at line 533 of file old_api.cc.

References MEM_32K_BUF, and memFree().

Referenced by memFreeBufFunc().

◆ memFree4K()

void memFree4K ( void *  p)
static

Definition at line 515 of file old_api.cc.

References MEM_4K_BUF, and memFree().

Referenced by memFreeBufFunc().

◆ memFree64K()

void memFree64K ( void *  p)
static

Definition at line 539 of file old_api.cc.

References MEM_64K_BUF, and memFree().

Referenced by memFreeBufFunc().

◆ memFree8K()

void memFree8K ( void *  p)
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()

FREE * memFreeBufFunc ( size_t  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()

int memInUse ( mem_type  type)

Definition at line 501 of file old_api.cc.

◆ memReallocBuf()

void * memReallocBuf ( void *  oldbuf,
size_t  net_size,
size_t gross_size 
)

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 void memStringStats ( std::ostream &  stream)
static

◆ operator++()

static mem_type & operator++ ( mem_type aMem)
static

Definition at line 460 of file old_api.cc.

References int.

Variable Documentation

◆ clean_interval

double clean_interval = 15.0
static

Definition at line 396 of file old_api.cc.

Referenced by Mem::CleanIdlePools().

◆ HugeBufCountMeter

Mem::Meter HugeBufCountMeter
static

Definition at line 55 of file old_api.cc.

Referenced by memAllocBuf(), memBufStats(), memFreeBuf(), and memFreeBufFunc().

◆ HugeBufVolumeMeter

Mem::Meter HugeBufVolumeMeter
static

Definition at line 56 of file old_api.cc.

Referenced by memAllocBuf(), memBufStats(), memFreeBuf(), and memFreeBufFunc().

◆ StrCountMeter

Mem::Meter StrCountMeter
static

Definition at line 52 of file old_api.cc.

Referenced by memAllocRigid(), memAllocString(), memFreeRigid(), memFreeString(), and memStringStats().

◆ StrVolumeMeter

Mem::Meter StrVolumeMeter
static

Definition at line 53 of file old_api.cc.

Referenced by memAllocRigid(), memAllocString(), memFreeRigid(), memFreeString(), and memStringStats().

◆ xm_deltat

double xm_deltat = 0
static

Definition at line 42 of file old_api.cc.

Referenced by DumpMallocStatistics(), Mem::PoolReport(), and Mem::Report().

◆ xm_time

double xm_time = 0
static

Definition at line 41 of file old_api.cc.

Referenced by DumpMallocStatistics(), and Mem::Report().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors