From 290a4cf9455f45895718ed698147061fcd0a2dcb Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 17 Dec 2020 13:20:53 +0100 Subject: depcache: Cache our InRootSetFunc This avoids the cost of setting up the function every time we mark and sweep. --- apt-pkg/depcache.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 78f88ba2f..9a6019092 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -380,6 +380,9 @@ class APT_PUBLIC pkgDepCache : protected pkgCache::Namespace */ virtual InRootSetFunc *GetRootSetFunc(); + /** This should return const really - do not delete. */ + InRootSetFunc *GetCachedRootSetFunc() APT_HIDDEN; + /** \return \b true if the garbage collector should follow recommendations. */ virtual bool MarkFollowsRecommends(); @@ -516,7 +519,8 @@ class APT_PUBLIC pkgDepCache : protected pkgCache::Namespace bool const rPurge, unsigned long const Depth, bool const FromUser); private: - void * const d; + struct Private; + Private *const d; APT_HIDDEN bool MarkInstall_StateChange(PkgIterator const &Pkg, bool AutoInst, bool FromUser); APT_HIDDEN bool MarkInstall_DiscardInstall(PkgIterator const &Pkg); -- cgit v1.2.3