kallocator.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef KALLOCATOR_H
00028 #define KALLOCATOR_H
00029
00030 #include <qvaluelist.h>
00031 #include "kdelibs_export.h"
00032
00033 class KZoneAllocatorPrivate;
00034
00035
00048 class KDECORE_EXPORT KZoneAllocator
00049 {
00050 public:
00055 KZoneAllocator(unsigned long _blockSize = 8*1024);
00056
00060 ~KZoneAllocator();
00061
00067 void* allocate(size_t _size);
00068
00089 void deallocate(void *ptr);
00090
00111 void free_since(void *ptr);
00112
00113 protected:
00114 class MemBlock;
00115 typedef QValueList<MemBlock *> MemList;
00116 void addBlock(MemBlock *b);
00117 void delBlock(MemBlock *b);
00118 void insertHash(MemBlock *b);
00119 void initHash();
00120 MemBlock *currentBlock;
00121 unsigned long blockSize;
00122 unsigned long blockOffset;
00123 unsigned int log2;
00124 unsigned int num_blocks;
00125 MemList **hashList;
00126 unsigned int hashSize;
00127 bool hashDirty;
00128 private:
00129 KZoneAllocatorPrivate *d;
00130 };
00131
00132 #endif
This file is part of the documentation for kdecore Library Version 3.3.90.