Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
kdecore
kdecore
kdecore
kallocator.h
1
/*
2
This file is part of the KDE libraries
3
4
Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
5
Copyright (C) 2002 Michael Matz (matz@kde.org)
6
7
This library is free software; you can redistribute it and/or
8
modify it under the terms of the GNU Library General Public
9
License as published by the Free Software Foundation; either
10
version 2 of the License, or (at your option) any later version.
11
12
This library is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
Library General Public License for more details.
16
17
You should have received a copy of the GNU Library General Public License
18
along with this library; see the file COPYING.LIB. If not, write to
19
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
Boston, MA 02110-1301, USA.
21
*/
22
//----------------------------------------------------------------------------
23
//
24
// KDE Memory Allocator
25
26
#ifndef KALLOCATOR_H
27
#define KALLOCATOR_H
28
29
#include <tqvaluelist.h>
30
#include "kdelibs_export.h"
31
32
class
KZoneAllocatorPrivate;
33
34
46
class
KDECORE_EXPORT
KZoneAllocator
47
{
48
public
:
53
KZoneAllocator
(
unsigned
long
_blockSize = 8*1024);
54
58
~
KZoneAllocator
();
59
65
void
* allocate(
size_t
_size);
66
87
void
deallocate(
void
*ptr);
88
109
void
free_since(
void
*ptr);
110
111
protected
:
113
class
MemBlock;
115
typedef
TQValueList<MemBlock *>
MemList
;
116
void
addBlock(MemBlock *b);
117
void
delBlock(MemBlock *b);
118
void
insertHash(MemBlock *b);
119
void
initHash();
121
MemBlock *
currentBlock
;
123
unsigned
long
blockSize
;
125
unsigned
long
blockOffset
;
127
unsigned
int
log2
;
129
unsigned
int
num_blocks
;
131
MemList
**
hashList
;
133
unsigned
int
hashSize
;
135
bool
hashDirty
;
136
private
:
137
KZoneAllocatorPrivate *d;
138
};
139
140
#endif
kdecore
Skip menu "kdecore"
Main Page
Modules
Namespace List
Class Hierarchy
Alphabetical List
Class List
File List
Namespace Members
Class Members
Related Pages
kdecore
Skip menu "kdecore"
arts
dcop
dnssd
interfaces
interface
library
kspeech
ktexteditor
kabc
kate
kcmshell
kdecore
kded
kdefx
kdeprint
kdesu
kdeui
kdoctools
khtml
kimgio
kinit
kio
bookmarks
httpfilter
kfile
kio
kioexec
kpasswdserver
kssl
kioslave
http
kjs
kmdi
kmdi
knewstuff
kparts
krandr
kresources
kspell2
kunittest
kutils
kwallet
libkmid
libkscreensaver