diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-03-16 16:59:31 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-03-16 20:35:59 +0100 |
commit | 3e6b194d78024373c2320f31f4ba0de3d0658b83 (patch) | |
tree | 76576868d1a0b728f1905e9df3ba3429f3deafe8 /src/libutil/compression.hh | |
parent | 64441f055194e9fd9e924a58e67cadb030ba918f (diff) |
decompress(): Use a Source and Sink
This allows decompression to happen in O(1) memory.
Diffstat (limited to 'src/libutil/compression.hh')
-rw-r--r-- | src/libutil/compression.hh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libutil/compression.hh b/src/libutil/compression.hh index a0d7530d7..f7a3e3fbd 100644 --- a/src/libutil/compression.hh +++ b/src/libutil/compression.hh @@ -8,10 +8,12 @@ namespace nix { -ref<std::string> compress(const std::string & method, const std::string & in, const bool parallel = false); - ref<std::string> decompress(const std::string & method, const std::string & in); +void decompress(const std::string & method, Source & source, Sink & sink); + +ref<std::string> compress(const std::string & method, const std::string & in, const bool parallel = false); + struct CompressionSink : BufferedSink { virtual void finish() = 0; |