From f961947e3335d36d671e6cddea969d71b42ba023 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Fri, 9 Feb 2024 17:57:29 -0800 Subject: [PATCH] Share one arena across batch --- ConflictSet.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 87298fc..aae7186 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -777,7 +777,8 @@ Vector getSearchPath(Arena &arena, Node *n) { } bool checkRangeRead(Node *n, const std::span begin, - const std::span end, int64_t readVersion) { + const std::span end, int64_t readVersion, + Arena &arena) { auto left = FirstGeqStepwise{n, begin}; auto right = FirstGeqStepwise{n, end}; bool leftDone = left.step(); @@ -829,7 +830,6 @@ bool checkRangeRead(Node *n, const std::span begin, return false; } - Arena arena{10 << 10}; auto searchPath = getSearchPath(arena, left.n); for (auto *iter = nextPhysical(left.n, searchPath); iter != right.n;) { @@ -945,6 +945,7 @@ void destroyTree(Node *root) { struct __attribute__((visibility("hidden"))) ConflictSet::Impl { void check(const ReadRange *reads, Result *result, int count) const { + Arena arena{64 << 10}; for (int i = 0; i < count; ++i) { result[i] = reads[i].readVersion < oldestVersion ? TooOld @@ -954,7 +955,7 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { reads[i].begin.len), std::span(reads[i].end.p, reads[i].end.len), - reads[i].readVersion) + reads[i].readVersion, arena) : checkPointRead(root, std::span(reads[i].begin.p, reads[i].begin.len),