6 std::size_t maxRecycle):
7 m_typeSize(typeSize), m_blockSize(blockSize), m_maxRecycle(maxRecycle), m_alive(0){
15 m_typeSize(rh.m_typeSize), m_blockSize(rh.m_blockSize), m_maxRecycle(rh.m_maxRecycle), m_alive(0) {
62 if (
m_alive>0 && !force)
return;
96 m_blockSize(blockSize), m_maxRecycle(maxRecycle), m_last(0), m_lastSize(0){}
104 Pool::iterator
p=
m_pool.find(typeSize);
144 return (s_usePool) ? allocator(
s).alloc() :
::operator new(
s);
160 (s_usePool) ? allocator(
s).dealloc(
p) :
::operator delete(
p);
std::vector< void * > recycled
std::vector< LocalCache * > localCaches
Allocator & allocator(std::size_t typeSize)
static BlockWipedAllocator & allocator(size_t s)
std::vector< unsigned char > m_data
BlockWipedPool & blockWipedPool(BlockWipedPool *p=0)
U second(std::pair< T, U > const &p)
BlockWipedAllocator & operator=(BlockWipedAllocator const &rh)
BlockWipedAllocator Allocator
BlockWipedPool(std::size_t blockSize, std::size_t maxRecycle)
static BlockWipedAllocator::Stat stat(size_t s)
void nextBlock(bool advance) dso_internal
block
Formating index page's pieces.
BlockWipedAllocator & me() const
void wipe(bool force=true)
Blocks::const_iterator const_iterator
void wipe(bool force=true) const
BlockWipedAllocator(std::size_t typeSize, std::size_t blockSize, std::size_t maxRecycle)