diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:53:34 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:53:34 +0000 |
commit | 2d11135a1b8e8ee0a21c7932d7ce08a89b354784 (patch) | |
tree | 7516c5025386801ae15773d4bed77a01bf1d69d3 /apt-pkg/contrib/mmap.h | |
parent | 25dbb396187255367674f264732db681538c87a2 (diff) |
Support for memory-only caching
Author: jgg
Date: 1999-04-18 06:36:36 GMT
Support for memory-only caching
Diffstat (limited to 'apt-pkg/contrib/mmap.h')
-rw-r--r-- | apt-pkg/contrib/mmap.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/apt-pkg/contrib/mmap.h b/apt-pkg/contrib/mmap.h index 3cb6c6468..0c11d3202 100644 --- a/apt-pkg/contrib/mmap.h +++ b/apt-pkg/contrib/mmap.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: mmap.h,v 1.8 1999/01/18 06:20:08 jgg Exp $ +// $Id: mmap.h,v 1.9 1999/04/18 06:36:36 jgg Exp $ /* ###################################################################### MMap Class - Provides 'real' mmap or a faked mmap using read(). @@ -36,17 +36,17 @@ class MMap { protected: - FileFd &Fd; - unsigned long Flags; + unsigned long Flags; unsigned long iSize; void *Base; - bool Map(); - bool Close(bool DoClose = true,bool DoSync = true); + bool Map(FileFd &Fd); + bool Close(bool DoSync = true); public: - enum OpenFlags {NoImmMap = (1<<0),Public = (1<<1),ReadOnly = (1<<2)}; + enum OpenFlags {NoImmMap = (1<<0),Public = (1<<1),ReadOnly = (1<<2), + UnMapped = (1<<3)}; // Simple accessors inline operator void *() {return Base;}; @@ -58,6 +58,7 @@ class MMap bool Sync(unsigned long Start,unsigned long Stop); MMap(FileFd &F,unsigned long Flags); + MMap(unsigned long Flags); virtual ~MMap(); }; @@ -75,6 +76,7 @@ class DynamicMMap : public MMap protected: + FileFd *Fd; unsigned long WorkSpace; Pool *Pools; unsigned int PoolCount; @@ -89,6 +91,7 @@ class DynamicMMap : public MMap 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); virtual ~DynamicMMap(); }; |