|
wavelength 1.0.0
|
Small-object allocator with one FixedSizeAlloc for each 16-byte size class up to 2048 bytes. More...
#include <ChunkAllocator.h>
Public Member Functions | |
| ChunkAllocator () | |
| Create an allocator with no size class in use. | |
| void * | Alloc (int size, int unused) |
| Allocate from the size class of a size, creating the class's allocator on first use. | |
| void | Free (void *mem, int size) |
| Free an allocation of a size class. | |
| void | Print (PrnStream &stream) |
| Print the use of every size class. | |
Small-object allocator with one FixedSizeAlloc for each 16-byte size class up to 2048 bytes.
The object is 0x200 bytes. The name comes from the assertions that guard its one instance, gChunkAlloc.
| ChunkAllocator::ChunkAllocator | ( | ) |
Create an allocator with no size class in use.
| void * ChunkAllocator::Alloc | ( | int | size, |
| int | unused ) |
Allocate from the size class of a size, creating the class's allocator on first use.
| size | The size in bytes. |
| unused | A value the routine does not read. |
| void ChunkAllocator::Free | ( | void * | mem, |
| int | size ) |
Free an allocation of a size class.
| mem | The allocation. |
| size | The size it was allocated with. |
| void ChunkAllocator::Print | ( | PrnStream & | stream | ) |
Print the use of every size class.
| stream | The destination. |