aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-02-12 12:50:37 +0100
committerGitHub <[email protected]>2024-02-12 12:50:37 +0100
commit4a7e46cadb0c0665a88a01cbc0a679ce4027abc6 (patch)
treef43c747764009ead4628b0f17aaecaff1a5cf746 /src/zencore/include
parentminor docs updates (diff)
downloadzen-4a7e46cadb0c0665a88a01cbc0a679ce4027abc6.tar.xz
zen-4a7e46cadb0c0665a88a01cbc0a679ce4027abc6.zip
Save compressed large attachments to temporary files on disk (#650)
* Save large compressed large attachments to temporary files on disk * bump oplog block max size up to 64Mb again * Make sure CompositeBuffer::AppendBuffers actually moves inputs when it should * removed parallell execution of fetching payload for block assembly it was not actually helping and added complexity * make sure we move/release payload buffers as soon as possible * make sure we don't read in full large attachments to memory when computing hash
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/compositebuffer.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/zencore/include/zencore/compositebuffer.h b/src/zencore/include/zencore/compositebuffer.h
index cc03dd156..1b6944fc0 100644
--- a/src/zencore/include/zencore/compositebuffer.h
+++ b/src/zencore/include/zencore/compositebuffer.h
@@ -125,11 +125,7 @@ private:
{
m_Segments.insert(m_Segments.end(), begin(Buffer.m_Segments), end(Buffer.m_Segments));
}
- inline void AppendBuffers(CompositeBuffer&& Buffer)
- {
- // TODO: this operates just like the by-reference version above
- m_Segments.insert(m_Segments.end(), begin(Buffer.m_Segments), end(Buffer.m_Segments));
- }
+ inline void AppendBuffers(CompositeBuffer&& Buffer) { AppendBuffers(std::move(Buffer.m_Segments)); }
static inline size_t GetBufferCount(const SharedBuffer&) { return 1; }
inline void AppendBuffers(const SharedBuffer& Buffer) { m_Segments.push_back(Buffer); }
@@ -138,7 +134,7 @@ private:
static inline size_t GetBufferCount(std::vector<SharedBuffer>&& Container) { return Container.size(); }
inline void AppendBuffers(std::vector<SharedBuffer>&& Container)
{
- m_Segments.insert(m_Segments.end(), begin(Container), end(Container));
+ m_Segments.insert(m_Segments.end(), std::make_move_iterator(Container.begin()), std::make_move_iterator(Container.end()));
}
private: