Dillo v3.1.1-98-g318d1f14
|
A simple allocator optimized to handle many small chunks of memory. More...
#include <misc.hh>
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 |
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().
|
inline |
|
inline |
Definition at line 646 of file misc.hh.
References bulk, pools, and zoneFree().
|
inline |
Definition at line 689 of file misc.hh.
References strndup().
Referenced by dw::TrieBuilder::insert(), and dw::Trie::load().
|
inline |
Definition at line 682 of file misc.hh.
References zoneAlloc().
Referenced by dw::Textblock::addText0(), dw::Textblock::hyphenateWord(), and strdup().
|
inline |
Definition at line 652 of file misc.hh.
References bulk, freeIdx, lout::misc::SimpleVector< T >::get(), lout::misc::SimpleVector< T >::increase(), poolLimit, pools, poolSize, lout::misc::SimpleVector< T >::set(), and lout::misc::SimpleVector< T >::size().
Referenced by strndup().
|
inline |
Definition at line 672 of file misc.hh.
References bulk, freeIdx, lout::misc::SimpleVector< T >::get(), pools, poolSize, lout::misc::SimpleVector< T >::setSize(), and lout::misc::SimpleVector< T >::size().
Referenced by dw::core::Layout::setWidget(), and ~ZoneAllocator().
|
private |
Definition at line 635 of file misc.hh.
Referenced by zoneAlloc(), zoneFree(), and ~ZoneAllocator().
|
private |
Definition at line 633 of file misc.hh.
Referenced by zoneAlloc(), and zoneFree().
|
private |
Definition at line 633 of file misc.hh.
Referenced by zoneAlloc().
|
private |
Definition at line 634 of file misc.hh.
Referenced by zoneAlloc(), zoneFree(), and ~ZoneAllocator().
|
private |
Definition at line 633 of file misc.hh.
Referenced by zoneAlloc(), ZoneAllocator(), and zoneFree().