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
- 
![[more]](icon1.gif) BlockAllocator(int asize, int ablocks = 100) BlockAllocator(int asize, int ablocks = 100)
- Create BlockAllocator for elements of size asize
- 
![[more]](icon1.gif) ~BlockAllocator() ~BlockAllocator()
- Delete all memeory
- 
![[more]](icon1.gif) void* Alloc() void* Alloc()
- Return pointer to new element
- 
![[more]](icon1.gif) void Free(void*  p) void Free(void*  p)
- Send memory to free-list
- Private Fields
- 
![[more]](icon1.gif) int size int size
- size of data
- 
![[more]](icon1.gif) int blocks int blocks
- number of blocks allocated at once
- 
![[more]](icon1.gif) void* freelist void* freelist
- single linked list of free elements
- 
![[more]](icon1.gif) ARRAY<char*>  bablocks ARRAY<char*>  bablocks
- pointers to blocks
 int size int size
- size of data
 
 
 int blocks int blocks
- number of blocks allocated at once
 
 
 void* freelist void* freelist
- single linked list of free elements
 
 
 ARRAY<char*>  bablocks ARRAY<char*>  bablocks
- pointers to blocks
 
 
 BlockAllocator(int asize, int ablocks = 100) BlockAllocator(int asize, int ablocks = 100)
- Create BlockAllocator for elements of size asize
 
 
 ~BlockAllocator() ~BlockAllocator()
- Delete all memeory
 
 
 void* Alloc() void* Alloc()
- Return pointer to new element
 
 
 void Free(void*  p) 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++.