summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/mmap.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2009-11-09 10:17:19 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2009-11-09 10:17:19 +0100
commitd6c4a9764d052c9755ab934c97c7a84c48ebd618 (patch)
tree81d435854988944f9dd2faa042d15644e66a89bf /apt-pkg/contrib/mmap.h
parent1a37c619614a9260968f1703d7c6aae5a9a139f7 (diff)
extent the mmap to be able to handle currently not implemented
(but planed) growable mmaps
Diffstat (limited to 'apt-pkg/contrib/mmap.h')
-rw-r--r--apt-pkg/contrib/mmap.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/apt-pkg/contrib/mmap.h b/apt-pkg/contrib/mmap.h
index bde62217d..cd2b15ba2 100644
--- a/apt-pkg/contrib/mmap.h
+++ b/apt-pkg/contrib/mmap.h
@@ -50,7 +50,7 @@ class MMap
public:
enum OpenFlags {NoImmMap = (1<<0),Public = (1<<1),ReadOnly = (1<<2),
- UnMapped = (1<<3)};
+ UnMapped = (1<<3), Moveable = (1<<4), Fallback = (1 << 5)};
// Simple accessors
inline operator void *() {return Base;};
@@ -82,6 +82,8 @@ class DynamicMMap : public MMap
FileFd *Fd;
unsigned long WorkSpace;
+ unsigned long const GrowFactor;
+ unsigned long const Limit;
Pool *Pools;
unsigned int PoolCount;
@@ -96,8 +98,10 @@ class DynamicMMap : public MMap
inline unsigned long WriteString(const string &S) {return WriteString(S.c_str(),S.length());};
void UsePools(Pool &P,unsigned int Count) {Pools = &P; PoolCount = Count;};
- DynamicMMap(FileFd &F,unsigned long Flags,unsigned long WorkSpace = 2*1024*1024);
- DynamicMMap(unsigned long Flags,unsigned long WorkSpace = 2*1024*1024);
+ DynamicMMap(FileFd &F,unsigned long Flags,unsigned long const &WorkSpace = 2*1024*1024,
+ unsigned long const &Grow = 1024*1024, unsigned long const &Limit = 0);
+ DynamicMMap(unsigned long Flags,unsigned long const &WorkSpace = 2*1024*1024,
+ unsigned long const &Grow = 1024*1024, unsigned long const &Limit = 0);
virtual ~DynamicMMap();
};