diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-30 14:21:32 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-30 14:21:32 +0000 |
commit | 959a019461a8bc4494813982195af9b558c724f9 (patch) | |
tree | 9aae19fedb6a834a92cb9a9b9565302d15aae0ed /searchlib | |
parent | a0aafd375b7f20404a08ad32a4a58f73b75a3165 (diff) |
Use vespalib::alloc::Allo instead. Will handle large documents smoother.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp b/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp index 4bd844f5059..d12a3a54a93 100644 --- a/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp +++ b/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp @@ -204,10 +204,10 @@ seek_past(LidInfoWithLidV::const_iterator begin, LidInfoWithLidV::const_iterator } struct LidAndBuffer { - LidAndBuffer(uint32_t lid, uint32_t sz, std::unique_ptr<char[]> buf) : _lid(lid), _size(sz), _buf(std::move(buf)) {} + LidAndBuffer(uint32_t lid, uint32_t sz, vespalib::alloc::Alloc buf) : _lid(lid), _size(sz), _buf(std::move(buf)) {} uint32_t _lid; uint32_t _size; - std::unique_ptr<char[]> _buf; + vespalib::alloc::Alloc _buf; }; } @@ -233,7 +233,7 @@ WriteableFileChunk::read(LidInfoWithLidV::const_iterator begin, size_t count, IB assert(chunk == _active->getId()); buffer = _active->getLid(li.getLid()); } - auto copy = std::make_unique<char[]>(buffer.size()); + auto copy = vespalib::alloc::Alloc::alloc(buffer.size()); memcpy(copy.get(), buffer.data(), buffer.size()); buffers.emplace_back(li.getLid(), buffer.size(), std::move(copy)); } else { @@ -243,7 +243,7 @@ WriteableFileChunk::read(LidInfoWithLidV::const_iterator begin, size_t count, IB } for (auto & entry : buffers) { visitor.visit(entry._lid, vespalib::ConstBufferRef(entry._buf.get(), entry._size)); - entry._buf.reset(); + entry._buf = vespalib::alloc::Alloc(); } for (auto & it : chunksOnFile) { auto first = find_first(begin, it.first); |