29#include <tqvaluelist.h>
30#include "tdelibs_export.h"
32class TDEZoneAllocatorPrivate;
118 void insertHash(MemBlock *b);
137 TDEZoneAllocatorPrivate *d;
void deallocate(void *ptr)
Gives back a block returned by allocate() to the zone allocator, and possibly deallocates the block h...
void addBlock(MemBlock *b)
Add a new memory block to the pool of blocks, and reorganize the hash lists if needed.
unsigned int log2
base-2 log of the block size.
MemList ** hashList
Collection of lists of blocks, for lookups.
unsigned long blockSize
Store block size from constructor.
unsigned int num_blocks
Count total number of allocated blocks.
unsigned long blockOffset
Store offset into current block; size-offset is free.
TDEZoneAllocator(unsigned long _blockSize=8 *1024)
Creates a TDEZoneAllocator object.
void free_since(void *ptr)
Deallocate many objects at once.
MemBlock * currentBlock
One block is 'current' to satisfy requests.
bool hashDirty
Flag the hashes as in need of reorganization.
unsigned int hashSize
Count of hashes.
void delBlock(MemBlock *b)
Delete a memory block.
void initHash()
Reinitialize hash list.
void * allocate(size_t _size)
Allocates a memory block.
TQValueList< MemBlock * > MemList
A list of chunks.