In file blockalloc.hpp: Optimized memory handler.
Documentation
Optimized memory handler.
Memory handler allocates many objects at once.
Maintains free list of deleted objects
Public Methods
-
BlockAllocator(int asize, int ablocks = 100)
- Create BlockAllocator for elements of size asize
-
~BlockAllocator()
- Delete all memeory
-
void* Alloc()
- Return pointer to new element
-
void Free(void* p)
- Send memory to free-list
Private Fields
-
int size
- size of data
-
int blocks
- number of blocks allocated at once
-
void* freelist
- single linked list of free elements
-
ARRAY<char*> bablocks
- pointers to blocks
- int size
- size of data
- int blocks
- number of blocks allocated at once
- void* freelist
- single linked list of free elements
- ARRAY<char*> bablocks
- pointers to blocks
- BlockAllocator(int asize, int ablocks = 100)
- Create BlockAllocator for elements of size asize
- ~BlockAllocator()
- Delete all memeory
- void* Alloc()
- Return pointer to new element
- void Free(void* p)
- Send memory to free-list
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.