kvmallocator.h
00001 /* 00002 This file is part of the KDE libraries 00003 00004 Copyright (C) 2000 Waldo Bastian (bastian@kde.org) 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 //---------------------------------------------------------------------------- 00022 // 00023 // KDE Virtual Memory Allocator 00024 00025 #ifndef KVMALLOCATOR_H 00026 #define KVMALLOCATOR_H 00027 00028 #include <sys/types.h> 00029 #include "kdelibs_export.h" 00030 00031 class KVMAllocatorPrivate; 00032 00039 class KDECORE_EXPORT KVMAllocator 00040 { 00041 public: 00042 struct Block; 00043 00047 KVMAllocator(); 00048 00052 ~KVMAllocator(); 00053 00059 Block *allocate(size_t _size); 00060 00065 void free(Block *block); 00066 00077 bool copyBlock(void *dest, Block *src, int _offset = 0, size_t length = 0); 00078 00083 void copy(void *dest, Block *src, int _offset = 0, size_t length = 0) KDE_DEPRECATED; 00084 00095 bool copyBlock(Block *dest, void *src, int _offset = 0, size_t length = 0); 00096 00101 void copy(Block *dest, void *src, int _offset = 0, size_t length = 0) KDE_DEPRECATED; 00102 00107 void *map(Block *block); 00108 00113 void unmap(Block *block); 00114 00115 private: 00116 KVMAllocatorPrivate *d; 00117 }; 00118 00119 #endif