# 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

- KZoneAllocator (long _blockSize = 128*1024)
- ~KZoneAllocator ()
- void* allocate (size_t _size)

#### Protected Members

- long blockSize
- QList<char> memoryBlocks
- char *currentBlock
- long blockOffset

## 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) | ### KZoneAllocator

Create a ZoneAllocator

Parameters:

_blockSize | Size in bytes of the blocks requested from malloc.

~KZoneAllocator () | ### ~KZoneAllocator

Destruct the ZoneAllocator and free all memory allocated by it.

void* allocate (size_t _size) | ### allocate

Allocate a memory block.

Parameters:

_size | Size in bytes of the memory block. Memory is not alligned!

long blockSize | ### blockSize

[protected]

QList<char> memoryBlocks | ### memoryBlocks

[protected]

char * currentBlock | ### currentBlock

[protected]

long blockOffset | ### blockOffset

[protected]

- Version: $Id: kallocator.h,v 1.3 2000/03/06 18:10:42 granroth Exp $
- Author: Waldo Bastian <bastian@kde.org>
- Generated: root@sparc.ports.openbsd.org on Wed May 2 09:34:58 2001, using kdoc 2.0a53.