summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-02-25 11:44:16 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2020-02-25 11:44:16 +0100
commitd8c6ea90784ecb4dabbf8c2cb7b631add50ae177 (patch)
tree5172f2f839fcf21297a3c98a422189237b82de44 /apt-pkg
parentf17e3ce8213ba364d1eea7b5bab286a2175e5875 (diff)
Add d-pointers to groups, packages, versions, and files
This allows us to extend those in-cache objects with more data later on without breaking the ABI. Reserve 12 pointers for private data in the pkgCache class, and double the size of pools to 24.
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/pkgcache.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h
index ef22a78a0..f68736ddc 100644
--- a/apt-pkg/pkgcache.h
+++ b/apt-pkg/pkgcache.h
@@ -230,6 +230,7 @@ class pkgCache /*{{{*/
Dependency *DepP;
DependencyData *DepDataP;
char *StrP;
+ void *reserved[12];
virtual bool ReMap(bool const &Errorchecks = true);
inline bool Sync() {return Map.Sync();}
@@ -365,10 +366,10 @@ struct pkgCache::Header
Start indicates the first byte of the pool, Count is the number of objects
remaining in the pool and ItemSize is the structure size (alignment factor)
of the pool. An ItemSize of 0 indicates the pool is empty. There should be
- the same number of pools as there are structure types. The generator
+ twice the number of pools as there are non-private structure types. The generator
stores this information so future additions can make use of any unused pool
blocks. */
- DynamicMMap::Pool Pools[12];
+ DynamicMMap::Pool Pools[2 * 12];
/** \brief hash tables providing rapid group/package name lookup
@@ -425,6 +426,8 @@ struct pkgCache::Group
/** \brief List of binary produces by source package with this name. */
map_pointer<Version> VersionsInSource;
+ /** \brief Private pointer */
+ map_pointer<void> d;
};
/*}}}*/
// Package structure /*{{{*/
@@ -487,6 +490,9 @@ struct pkgCache::Package
map_id_t ID;
/** \brief some useful indicators of the package's state */
map_flags_t Flags;
+
+ /** \brief Private pointer */
+ map_pointer<void> d;
};
/*}}}*/
// Release File structure /*{{{*/
@@ -527,6 +533,9 @@ struct pkgCache::ReleaseFile
map_pointer<ReleaseFile> NextFile;
/** \brief unique sequel ID */
map_fileid_t ID;
+
+ /** \brief Private pointer */
+ map_pointer<void> d;
};
/*}}}*/
// Package File structure /*{{{*/
@@ -566,6 +575,9 @@ struct pkgCache::PackageFile
map_pointer<PackageFile> NextFile;
/** \brief unique sequel ID */
map_fileid_t ID;
+
+ /** \brief Private pointer */
+ map_pointer<void> d;
};
/*}}}*/
// VerFile structure /*{{{*/
@@ -670,6 +682,9 @@ struct pkgCache::Version
map_number_t Priority;
/** \brief next version in the source package (might be different binary) */
map_pointer<Version> NextInSource;
+
+ /** \brief Private pointer */
+ map_pointer<void> d;
};
/*}}}*/
// Description structure /*{{{*/