class KZoneAllocator

Memory allocator for large groups of small objects. More...

Definition#include <kallocator.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Members


Detailed Description

Memory allocator for large groups of small objects. This should be used for large groups of objects that are created and destroyed together. When used carefully for this purpose it is faster and more memory efficient than malloc.

 KZoneAllocator (long _blockSize = 128*1024)

Create a ZoneAllocator

Parameters:
_blockSizeSize in bytes of the blocks requested from malloc.

 ~KZoneAllocator ()

Destruct the ZoneAllocator and free all memory allocated by it.

void*  allocate (size_t _size)

Allocate a memory block.

Parameters:
_sizeSize in bytes of the memory block. Memory is not alligned!

long blockSize

[protected: ]

QList<char> memoryBlocks

[protected: ]

char * currentBlock

[protected: ]

long blockOffset

[protected: ]