aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2026-01-08 18:06:35 +0100
committerGitHub Enterprise <[email protected]>2026-01-08 18:06:35 +0100
commit2cce46afe7b30741806d3dd3261e97c8d3788082 (patch)
tree99d442e35b16d865292f35b865a66587290e1d29 /src
parentoptimize scavenge part 2 (#699) (diff)
downloadzen-2cce46afe7b30741806d3dd3261e97c8d3788082.tar.xz
zen-2cce46afe7b30741806d3dd3261e97c8d3788082.zip
read build state files into memory instead of relying on memory mapping (#702)
Diffstat (limited to 'src')
-rw-r--r--src/zenremotestore/builds/buildsavedstate.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/zenremotestore/builds/buildsavedstate.cpp b/src/zenremotestore/builds/buildsavedstate.cpp
index 5a86ee865..1d1f4605f 100644
--- a/src/zenremotestore/builds/buildsavedstate.cpp
+++ b/src/zenremotestore/builds/buildsavedstate.cpp
@@ -207,9 +207,14 @@ ReadBuildSaveStateFile(const std::filesystem::path& StateFilePath)
{
ZEN_TRACE_CPU("ReadStateFile");
- FileContents FileData = ReadFile(StateFilePath);
+ IoBuffer DataBuffer;
+ {
+ BasicFile Source(StateFilePath, BasicFile::Mode::kRead);
+ DataBuffer = Source.ReadAll();
+ }
+
CbValidateError ValidateError;
- if (CbObject CurrentStateObject = ValidateAndReadCompactBinaryObject(FileData.Flatten(), ValidateError);
+ if (CbObject CurrentStateObject = ValidateAndReadCompactBinaryObject(std::move(DataBuffer), ValidateError);
ValidateError == CbValidateError::None)
{
if (CurrentStateObject)