diff options
| author | David Kalnischkies <david@kalnischkies.de> | 2025-01-30 16:39:40 +0000 |
|---|---|---|
| committer | David Kalnischkies <david@kalnischkies.de> | 2025-01-30 16:39:40 +0000 |
| commit | 1bc221a9dd22baa6e2e516d45dc858774cafddd0 (patch) | |
| tree | 599e85d846e9066793a621b423456e3b11a283c1 | |
| parent | 2e39d0fdeff5f9db91b3490d6750c8033aca9057 (diff) | |
Drop unused description size info from binary cache
Nothing in src:apt uses this information and that isn't all to
surprising as it is usually not that interesting to know how big
a specific stanza of a description is as the max size is available
and you are usually working with more than one description.
So this information just takes up space in our binary cacheā¦
64 bits per structure which can quickly add up to whole MBs
depending on how many (and which) sources you have enabled.
| -rw-r--r-- | apt-pkg/pkgcache.h | 5 | ||||
| -rw-r--r-- | apt-pkg/pkgcachegen.cc | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index f6d0ea097..d5d8fcad3 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -618,8 +618,9 @@ struct pkgCache::DescFile map_pointer<DescFile> NextFile; /** \brief position in the file */ map_filesize_t Offset; // File offset - /** @TODO document pkgCache::DescFile::Size */ - map_filesize_t Size; +#if APT_PKG_ABI <= 600 + [[deprecated("No usage in src:apt, try MaxDescFileSize instead")]] map_filesize_t Size; +#endif }; /*}}}*/ // Version structure /*{{{*/ diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index aaa969a8d..76dea6266 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -949,9 +949,14 @@ bool pkgCacheGenerator::NewFileDesc(pkgCache::DescIterator &Desc, *Last = DF.MapPointer(); DF->Offset = List.Offset(); - DF->Size = List.Size(); - if (Cache.HeaderP->MaxDescFileSize < DF->Size) - Cache.HeaderP->MaxDescFileSize = DF->Size; + auto const Size = List.Size(); + if (Cache.HeaderP->MaxDescFileSize < Size) + Cache.HeaderP->MaxDescFileSize = Size; +#if APT_PKG_ABI <= 600 + APT_IGNORE_DEPRECATED_PUSH + DF->Size = Size; + APT_IGNORE_DEPRECATED_POP +#endif Cache.HeaderP->DescFileCount++; return true; |
