105 m_free_cells = seekMemory();
106 Cell* c = m_free_cells;
107 m_free_cells = c->m_next;
110 m_last_free_cell = 0;
122 return m_admin->m_cellsize;
132 return m_admin->cellsExisting() - cellsFree();
154 #ifdef DEBUG_RELEASE_MEM
155 checkAllocatedCell(p);
157 Cell* c =
static_cast<Cell*
>(p);
161 m_free_cells = m_last_free_cell = c;
163 m_last_free_cell->m_next = c;
164 m_last_free_cell = c;
167 c->m_next = m_free_cells;
197 void initialize(
size_t dbls_per_cell,
size_t cells_per_superblock);
205 return m_admin->m_superblocksize;
211 Cell(Cell* next = 0) : m_next(next) {}
219 const size_t m_cellsize;
220 const size_t m_cells_per_superblock;
221 const size_t m_superblocksize;
222 std::vector<void*> m_superblocks;
224 Admin(
size_t dbls_per_cell,
size_t cells_per_superblock)
225 : m_cellsize(dbls_per_cell*sizeof(double)),
226 m_cells_per_superblock(cells_per_superblock),
227 m_superblocksize(m_cellsize*cells_per_superblock)
230 size_t cellsExisting()
const
232 return m_cells_per_superblock*m_superblocks.size();
238 Cell* m_last_free_cell;
243 unsigned int cellsFree()
const;
247 void checkCell(
const void* p)
const;
251 void checkAllocatedCell(
const void* p)
const;
255 Cell* seekMemory() throw (std::bad_alloc);