dillo  3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
  Fossies Dox: dillo-3.0.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

lout::misc::ZoneAllocator Class Reference

A simple allocator optimized to handle many small chunks of memory. The chunks can not be free'd individually. Instead the whole zone must be free'd with zoneFree(). More...

#include <misc.hh>

Collaboration diagram for lout::misc::ZoneAllocator:
[legend]

Public Member Functions

 ZoneAllocator (size_t poolSize)
 
 ~ZoneAllocator ()
 
void * zoneAlloc (size_t t)
 
void zoneFree ()
 
const char * strndup (const char *str, size_t t)
 
const char * strdup (const char *str)
 

Private Attributes

size_t poolSize
 
size_t poolLimit
 
size_t freeIdx
 
SimpleVector< char * > * pools
 
SimpleVector< char * > * bulk
 

Detailed Description

A simple allocator optimized to handle many small chunks of memory. The chunks can not be free'd individually. Instead the whole zone must be free'd with zoneFree().

Definition at line 549 of file misc.hh.

Constructor & Destructor Documentation

◆ ZoneAllocator()

lout::misc::ZoneAllocator::ZoneAllocator ( size_t  poolSize)
inline

Definition at line 557 of file misc.hh.

References poolSize.

◆ ~ZoneAllocator()

lout::misc::ZoneAllocator::~ZoneAllocator ( )
inline

Definition at line 565 of file misc.hh.

References bulk, pools, and zoneFree().

Member Function Documentation

◆ strdup()

const char* lout::misc::ZoneAllocator::strdup ( const char *  str)
inline

Definition at line 608 of file misc.hh.

References strndup().

◆ strndup()

const char* lout::misc::ZoneAllocator::strndup ( const char *  str,
size_t  t 
)
inline

Definition at line 601 of file misc.hh.

References zoneAlloc().

Referenced by strdup().

◆ zoneAlloc()

void* lout::misc::ZoneAllocator::zoneAlloc ( size_t  t)
inline

◆ zoneFree()

void lout::misc::ZoneAllocator::zoneFree ( )
inline

Member Data Documentation

◆ bulk

SimpleVector<char*>* lout::misc::ZoneAllocator::bulk
private

Definition at line 554 of file misc.hh.

Referenced by zoneAlloc(), zoneFree(), and ~ZoneAllocator().

◆ freeIdx

size_t lout::misc::ZoneAllocator::freeIdx
private

Definition at line 552 of file misc.hh.

Referenced by zoneAlloc(), and zoneFree().

◆ poolLimit

size_t lout::misc::ZoneAllocator::poolLimit
private

Definition at line 552 of file misc.hh.

Referenced by zoneAlloc().

◆ pools

SimpleVector<char*>* lout::misc::ZoneAllocator::pools
private

Definition at line 553 of file misc.hh.

Referenced by zoneAlloc(), zoneFree(), and ~ZoneAllocator().

◆ poolSize

size_t lout::misc::ZoneAllocator::poolSize
private

Definition at line 552 of file misc.hh.

Referenced by zoneAlloc(), ZoneAllocator(), and zoneFree().


The documentation for this class was generated from the following file: