diff options
| author | Dan Engelbrecht <[email protected]> | 2025-03-18 09:48:52 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-03-18 09:48:52 +0100 |
| commit | 0295cd45276c9b99f72dd0f35f3b5d5ffe7cb0df (patch) | |
| tree | 007d94ef784fe20644e2a3a88a879ff406a3d07f /src/zencore/basicfile.cpp | |
| parent | Reduced disk I/O when writing out chunk blocks during download (#309) (diff) | |
| download | zen-0295cd45276c9b99f72dd0f35f3b5d5ffe7cb0df.tar.xz zen-0295cd45276c9b99f72dd0f35f3b5d5ffe7cb0df.zip | |
collapse local writes (#310)
* collapse read/writes during local data copy
Diffstat (limited to 'src/zencore/basicfile.cpp')
| -rw-r--r-- | src/zencore/basicfile.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/zencore/basicfile.cpp b/src/zencore/basicfile.cpp index 95876cff4..a181bbd66 100644 --- a/src/zencore/basicfile.cpp +++ b/src/zencore/basicfile.cpp @@ -796,6 +796,12 @@ BasicFileWriter::Write(const void* Data, uint64_t Size, uint64_t FileOffset) { if (m_Buffer == nullptr || (Size >= m_BufferSize)) { + if (FileOffset == m_BufferEnd) + { + Flush(); + m_BufferStart = m_BufferEnd = FileOffset + Size; + } + m_Base.Write(Data, Size, FileOffset); return; } |