Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
tdecore
tdecore
tdecore
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 "tdelibs_export.h"
31
32
class
TDEZoneAllocatorPrivate;
33
34
46
class
TDECORE_EXPORT
TDEZoneAllocator
47
{
48
public
:
53
TDEZoneAllocator
(
unsigned
long
_blockSize = 8*1024);
54
58
~
TDEZoneAllocator
();
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
TDEZoneAllocatorPrivate *d;
138
};
139
140
#endif
tdecore
Skip menu "tdecore"
Main Page
Modules
Namespace List
Class Hierarchy
Alphabetical List
Class List
File List
Namespace Members
Class Members
Related Pages
tdecore
Skip menu "tdecore"
arts
dcop
dnssd
interfaces
kspeech
interface
library
tdetexteditor
kate
kded
kdoctools
kimgio
kjs
libtdemid
libtdescreensaver
tdecore
tdeabc
tdecmshell
tdecore
tdefx
tdehtml
tdeinit
tdeio
bookmarks
httpfilter
kpasswdserver
kssl
tdeioslave
http
tdefile
tdeio
tdeioexec
tdemdi
tdemdi
tdenewstuff
tdeparts
tdeprint
tderandr
tderesources
tdespell2
tdesu
tdeui
tdeunittest
tdeutils
tdewallet