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>

List of all members.

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().

Constructor & Destructor Documentation

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

References bulk, freeIdx, poolLimit, and pools.

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

References bulk, pools, and zoneFree().


Member Function Documentation

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

References strndup().

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

References zoneAlloc().

Referenced by strdup().

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

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


Member Data Documentation

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

Referenced by zoneAlloc(), and ZoneAllocator().

Referenced by zoneAlloc(), and zoneFree().


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

Generated on Wed Sep 7 02:00:38 2011 for Dillo by  doxygen 1.5.9