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/forward.h"
#include "mem/Meter.h"
#include "mem/Pool.h"
#include "MemBuf.h"
#include "mgr/Registration.h"
#include "SquidConfig.h"
#include "SquidTime.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 MemAllocator *& GetPool (size_t type)
 
static MemAllocatorGetStrPool (size_t type)
 
static MemAllocatormemFindStringPool (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)
 
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)
 
static int MemPoolReportSorter (const void *a, const void *b)
 

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 46 of file old_api.cc.

Referenced by GetStrPool(), memFindStringPool(), memStringCount(), and memStringStats().

Function Documentation

◆ cxx_xfree()

static void cxx_xfree ( void *  ptr)
static

Definition at line 571 of file old_api.cc.

References xfree.

Referenced by memFreeBufFunc().

◆ GetPool()

static MemAllocator*& GetPool ( size_t  type)
static

Definition at line 64 of file old_api.cc.

References Mem::Init(), MEM_MAX, and type.

Referenced by Mem::Init(), memAllocate(), memCheckInit(), memDataInit(), memFree(), and memInUse().

◆ GetStrPool()

static MemAllocator& GetStrPool ( size_t  type)
static

◆ memAllocate()

void* memAllocate ( mem_type  type)

Definition at line 214 of file old_api.cc.

References MemAllocator::alloc(), assert, and GetPool().

Referenced by memAllocBuf().

◆ memAllocBuf()

void* memAllocBuf ( size_t  net_size,
size_t gross_size 
)

Definition at line 345 of file old_api.cc.

References HugeBufCountMeter, MEM_NONE, memAllocate(), memFindBufSizeType(), type, and xcalloc.

Referenced by memReallocBuf().

◆ memAllocRigid()

void* memAllocRigid ( size_t  net_size)

Definition at line 249 of file old_api.cc.

References memFindStringPool(), StrCountMeter, and xmalloc.

◆ memAllocString()

void* memAllocString ( size_t  net_size,
size_t gross_size 
)

Definition at line 230 of file old_api.cc.

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

◆ memBufStats()

static void memBufStats ( std::ostream &  stream)
static

Definition at line 158 of file old_api.cc.

References Mem::Meter::currentLevel().

Referenced by Mem::Stats().

◆ memCheckInit()

void memCheckInit ( void  )

Definition at line 498 of file old_api.cc.

References assert, GetPool(), MEM_MAX, and MEM_NONE.

◆ memClean()

◆ memConfigure()

void memConfigure ( void  )

◆ memDataInit()

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

Definition at line 201 of file old_api.cc.

References assert, GetPool(), memPoolCreate, NULL, and MemAllocator::zeroBlocks().

Referenced by Mem::Init().

◆ memFindBufSizeType()

static mem_type memFindBufSizeType ( size_t  net_size,
size_t gross_size 
)
static

Definition at line 309 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, size, and type.

Referenced by memAllocBuf(), and memFreeBuf().

◆ memFindStringPool()

static MemAllocator* memFindStringPool ( size_t  net_size,
bool  fuzzy 
)
static
Returns
the best-fit string pool or nil

Definition at line 118 of file old_api.cc.

References GetStrPool(), i, 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 553 of file old_api.cc.

References MEM_16K_BUF, and memFree().

Referenced by memFreeBufFunc().

◆ memFree2K()

void memFree2K ( void *  p)
static

Definition at line 535 of file old_api.cc.

References MEM_2K_BUF, and memFree().

Referenced by memFreeBufFunc().

◆ memFree32K()

void memFree32K ( void *  p)
static

Definition at line 559 of file old_api.cc.

References MEM_32K_BUF, and memFree().

Referenced by memFreeBufFunc().

◆ memFree4K()

void memFree4K ( void *  p)
static

Definition at line 541 of file old_api.cc.

References MEM_4K_BUF, and memFree().

Referenced by memFreeBufFunc().

◆ memFree64K()

void memFree64K ( void *  p)
static

Definition at line 565 of file old_api.cc.

References MEM_64K_BUF, and memFree().

Referenced by memFreeBufFunc().

◆ memFree8K()

void memFree8K ( void *  p)
static

Definition at line 547 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 384 of file old_api.cc.

References HugeBufCountMeter, MEM_NONE, memFindBufSizeType(), memFree(), NULL, size, type, and xfree.

Referenced by memReallocBuf().

◆ memFreeBufFunc()

FREE* memFreeBufFunc ( size_t  size)

◆ memFreeRigid()

void memFreeRigid ( void *  buf,
size_t  net_size 
)

Definition at line 291 of file old_api.cc.

References memFindStringPool(), StrCountMeter, and xfree.

◆ memFreeString()

void memFreeString ( size_t  size,
void *  buf 
)

Definition at line 277 of file old_api.cc.

References assert, memFindStringPool(), size, StrCountMeter, and xfree.

◆ memInUse()

int memInUse ( mem_type  type)

Definition at line 527 of file old_api.cc.

References GetPool(), and MemAllocator::inUseCount().

◆ MemPoolReportSorter()

static int MemPoolReportSorter ( const void *  a,
const void *  b 
)
static

◆ memReallocBuf()

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

Definition at line 360 of file old_api.cc.

References memAllocBuf(), and memFreeBuf().

◆ memStringCount()

size_t memStringCount ( )

Definition at line 265 of file old_api.cc.

References GetStrPool(), MemAllocator::inUseCount(), and mem_str_pool_count.

Referenced by String::caseCmp().

◆ memStringStats()

static void memStringStats ( std::ostream &  stream)
static

Definition at line 131 of file old_api.cc.

References Mem::Meter::currentLevel(), GetStrPool(), i, mem_str_pool_count, and xpercentInt().

Referenced by Mem::Stats().

◆ operator++()

mem_type& operator++ ( mem_type aMem)

Definition at line 487 of file old_api.cc.

References int.

Variable Documentation

◆ clean_interval

double clean_interval = 15.0
static

Definition at line 397 of file old_api.cc.

Referenced by Mem::CleanIdlePools().

◆ HugeBufCountMeter

Mem::Meter HugeBufCountMeter
static

Definition at line 56 of file old_api.cc.

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

◆ HugeBufVolumeMeter

Mem::Meter HugeBufVolumeMeter
static

Definition at line 57 of file old_api.cc.

◆ StrCountMeter

Mem::Meter StrCountMeter
static

Definition at line 53 of file old_api.cc.

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

◆ StrVolumeMeter

Mem::Meter StrVolumeMeter
static

Definition at line 54 of file old_api.cc.

◆ xm_deltat

double xm_deltat = 0
static

Definition at line 43 of file old_api.cc.

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

◆ xm_time

double xm_time = 0
static

Definition at line 42 of file old_api.cc.

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors