diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-09-10 15:34:28 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-09-10 17:03:03 +0000 |
commit | 9f0451f9bc186a3ba84c751e0d959c6b90b4d58a (patch) | |
tree | 205615c6ea134b41a02c71efbe0fbf3659f422c7 /searchlib | |
parent | 2f6d5764a8ac5fea80e44fc3d022a6b0b47ba890 (diff) |
Keep the backing buffer
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/transactionlog/chunks.cpp | 6 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/transactionlog/chunks.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/searchlib/src/vespa/searchlib/transactionlog/chunks.cpp b/searchlib/src/vespa/searchlib/transactionlog/chunks.cpp index 19309272c63..a78db61429d 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/chunks.cpp +++ b/searchlib/src/vespa/searchlib/transactionlog/chunks.cpp @@ -94,14 +94,18 @@ XXH64CompressedChunk::decompress(nbostream & is, uint32_t uncompressedLen) { ::decompress(_type, uncompressedLen, compressed, uncompressed, false); nbostream data(uncompressed.getData(), uncompressed.getDataLen()); deserializeEntries(data); + _backing = uncompressed.stealBuffer(); is.adjustReadPos(is.size()); } XXH64CompressedChunk::XXH64CompressedChunk(CompressionConfig::Type type, uint8_t level) : _type(type), - _level(level) + _level(level), + _backing() { } +XXH64CompressedChunk::~XXH64CompressedChunk() = default; + Encoding XXH64CompressedChunk::compress(nbostream & os, Encoding::Crc crc) const { nbostream org; diff --git a/searchlib/src/vespa/searchlib/transactionlog/chunks.h b/searchlib/src/vespa/searchlib/transactionlog/chunks.h index 9b09a0b20fb..6875a1708d9 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/chunks.h +++ b/searchlib/src/vespa/searchlib/transactionlog/chunks.h @@ -28,6 +28,7 @@ class XXH64CompressedChunk : public IChunk { public: using CompressionConfig = vespalib::compression::CompressionConfig; XXH64CompressedChunk(CompressionConfig::Type, uint8_t level); + ~XXH64CompressedChunk() override; protected: void decompress(nbostream & os, uint32_t uncompressedLen); Encoding compress(nbostream & os, Encoding::Crc crc) const; @@ -36,6 +37,7 @@ protected: private: CompressionConfig::Type _type; uint8_t _level; + vespalib::alloc::Alloc _backing; }; } |