]> git.ipfire.org Git - thirdparty/ccache.git/commit
chore: Simplify cache entry reading and writing
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 11 Sep 2022 11:48:05 +0000 (13:48 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 21 Sep 2022 15:06:29 +0000 (17:06 +0200)
commita03f14b7560f12eb28d6da1a60efc2bde4d2faf5
treeffc62ac2a78ba668b571dc9e4b6b42937122ff21
parente8def923d74dc68b4bbcb80177563f8ff23b5767
chore: Simplify cache entry reading and writing

Cache entries are now fully read into memory before (de)compressing,
checksumming and parsing, instead of streaming data like before. While
this increases memory usage when working with large object files, it
also simplifies the code a lot. Another motivation for this change is
that cache entry data is not streamed from secondary storage anyway, and
it makes sense to keep the architecture simple and similar for primary
and secondary storage code paths.

The cache entry format has modified so that the checksum covers the
potentially compressed payload (plus the header), not the uncompressed
payload (plus the header) like before. The checksum is now also stored
in an uncompressed epilogue. Since the cache entry format has been
changed, the input hash has been changed as well.
50 files changed:
ARCHITECTURE.md
src/CMakeLists.txt
src/Config.cpp
src/ccache.cpp
src/compression/CMakeLists.txt [deleted file]
src/compression/Compressor.cpp [deleted file]
src/compression/Compressor.hpp [deleted file]
src/compression/Decompressor.cpp [deleted file]
src/compression/Decompressor.hpp [deleted file]
src/compression/NullCompressor.cpp [deleted file]
src/compression/NullCompressor.hpp [deleted file]
src/compression/NullDecompressor.cpp [deleted file]
src/compression/NullDecompressor.hpp [deleted file]
src/compression/ZstdCompressor.cpp [deleted file]
src/compression/ZstdCompressor.hpp [deleted file]
src/compression/ZstdDecompressor.cpp [deleted file]
src/compression/ZstdDecompressor.hpp [deleted file]
src/compression/types.cpp [deleted file]
src/core/CMakeLists.txt
src/core/CacheEntry.cpp [new file with mode: 0644]
src/core/CacheEntry.hpp [new file with mode: 0644]
src/core/CacheEntryHeader.cpp [deleted file]
src/core/CacheEntryHeader.hpp [deleted file]
src/core/CacheEntryReader.cpp [deleted file]
src/core/CacheEntryReader.hpp [deleted file]
src/core/CacheEntryWriter.cpp [deleted file]
src/core/CacheEntryWriter.hpp [deleted file]
src/core/ChecksummingReader.hpp [deleted file]
src/core/ChecksummingWriter.hpp [deleted file]
src/core/FileReader.hpp [deleted file]
src/core/FileWriter.hpp [deleted file]
src/core/Manifest.cpp
src/core/Manifest.hpp
src/core/Reader.hpp [deleted file]
src/core/Result.cpp
src/core/Result.hpp
src/core/Serializer.hpp [moved from src/compression/types.hpp with 69% similarity]
src/core/Writer.hpp [deleted file]
src/core/mainoptions.cpp
src/core/types.cpp
src/core/types.hpp
src/storage/primary/PrimaryStorage_cleanup.cpp
src/storage/primary/PrimaryStorage_compress.cpp
src/util/CMakeLists.txt
src/util/XXH3_128.hpp
unittest/CMakeLists.txt
unittest/test_NullCompression.cpp [deleted file]
unittest/test_ZstdCompression.cpp [deleted file]
unittest/test_compression_types.cpp
unittest/test_util_XXH3_128.cpp