diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2010-07-08 15:28:53 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2010-07-08 15:28:53 +0200 |
commit | a9fe592842bfa17d91f4904d7fb0e3af3adebb17 (patch) | |
tree | 711c7ddc538476e8b88dfb8b6d76361db5754c1e /apt-pkg/cacheiterators.h | |
parent | 32b9a14cb4c6bdcddfe84c4451c225ced1a34bb7 (diff) |
* apt-pkg/pkgcachegen.{cc,h}:
- make the used MMap moveable (and therefore dynamic resizeable) by
applying (some) mad pointer magic (Closes: #195018)
Diffstat (limited to 'apt-pkg/cacheiterators.h')
-rw-r--r-- | apt-pkg/cacheiterators.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index dfe5707e1..eb8dee5e3 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -75,6 +75,12 @@ template<typename Str, typename Itr> class pkgCache::Iterator : inline bool IsGood() const { return S && Owner && ! end();}; inline unsigned long Index() const {return S - OwnerPointer();}; + void ReOwn(pkgCache &newOwner, void const * const oldMap, void const * const newMap) { + if (S == 0) + return; + S += (Str*)(newMap) - (Str*)(oldMap); + } + // Constructors - look out for the variable assigning inline Iterator() : S(0), Owner(0) {}; inline Iterator(pkgCache &Owner,Str *T = 0) : S(T), Owner(&Owner) {}; |