In file blockalloc.hpp:

class BlockAllocator

Optimized memory handler.

Documentation

Optimized memory handler. Memory handler allocates many objects at once. Maintains free list of deleted objects

Public Methods

[more] BlockAllocator(int asize, int ablocks = 100)
Create BlockAllocator for elements of size asize
[more] ~BlockAllocator()
Delete all memeory
[more]void* Alloc()
Return pointer to new element
[more]void Free(void* p)
Send memory to free-list

Private Fields

[more]int size
size of data
[more]int blocks
number of blocks allocated at once
[more]void* freelist
single linked list of free elements
[more]ARRAY<char*> bablocks
pointers to blocks

oint size
size of data

oint blocks
number of blocks allocated at once

ovoid* freelist
single linked list of free elements

oARRAY<char*> bablocks
pointers to blocks

o BlockAllocator(int asize, int ablocks = 100)
Create BlockAllocator for elements of size asize

o ~BlockAllocator()
Delete all memeory

ovoid* Alloc()
Return pointer to new element

ovoid 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++.