From cecfcc0da7bc01532f3002d65ce1d1a2b9654b89 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Fri, 12 Jul 2024 14:52:42 -0700 Subject: [PATCH] Fix build --- ConflictSet.cpp | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index c11ee2c..2d2177a 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -1715,17 +1715,17 @@ struct SearchStepWise { } }; -void onPointRead(ConflictSet::Impl *impl); -void onPrefixRead(ConflictSet::Impl *impl); -void onRangeRead(ConflictSet::Impl *impl); -void onCheckMaxBetween(ConflictSet::Impl *impl); +thread_local double accume_point_read = 0; +thread_local double accume_prefix_read = 0; +thread_local double accume_range_read = 0; +thread_local double accume_max_between = 0; // Logically this is the same as performing firstGeq and then checking against // point or range version according to cmp, but this version short circuits as // soon as it can prove that there's no conflict. bool checkPointRead(Node *n, const std::span key, InternalVersionT readVersion, ConflictSet::Impl *impl) { - onPointRead(impl); + ++accume_point_read; #if DEBUG_VERBOSE && !defined(NDEBUG) fprintf(stderr, "Check point read: %s\n", printable(key).c_str()); #endif @@ -1803,7 +1803,7 @@ downLeftSpine: // short circuits as soon as it can prove that there's no conflict. bool checkPrefixRead(Node *n, const std::span key, InternalVersionT readVersion, ConflictSet::Impl *impl) { - onPrefixRead(impl); + ++accume_prefix_read; #if DEBUG_VERBOSE && !defined(NDEBUG) fprintf(stderr, "Check prefix read: %s\n", printable(key).c_str()); #endif @@ -2045,6 +2045,7 @@ scan16(const InternalVersionT *vs, int begin, int end, template bool checkMaxBetweenExclusive(Node *n, int begin, int end, InternalVersionT readVersion) { + ++accume_max_between; assume(-1 <= begin); assume(begin <= 256); assume(-1 <= end); @@ -2319,7 +2320,6 @@ bool checkRangeStartsWith(Node *n, std::span key, int begin, #endif auto remaining = key; if (remaining.size() == 0) { - onCheckMaxBetween(impl); return checkMaxBetweenExclusive(n, begin, end, readVersion); } @@ -2416,7 +2416,6 @@ template struct CheckRangeLeftSide { } if (searchPathLen >= prefixLen) { - onCheckMaxBetween(impl); if (!checkMaxBetweenExclusive(n, remaining[0], 256, readVersion)) { ok = false; @@ -2547,7 +2546,6 @@ template struct CheckRangeRightSide { return true; } - onCheckMaxBetween(impl); if (!checkMaxBetweenExclusive(n, -1, remaining[0], readVersion)) { ok = false; @@ -2645,7 +2643,7 @@ template bool checkRangeReadImpl(Node *n, std::span begin, std::span end, InternalVersionT readVersion, ConflictSet::Impl *impl) { - onRangeRead(impl); + ++accume_range_read; int lcp = longestCommonPrefix(begin.data(), end.data(), std::min(begin.size(), end.size())); if (lcp == int(begin.size()) && end.size() == begin.size() + 1 && @@ -3060,11 +3058,6 @@ Node *firstGeqPhysical(Node *n, const std::span key) { } } -thread_local double accume_point_read = 0; -thread_local double accume_prefix_read = 0; -thread_local double accume_range_read = 0; -thread_local double accume_max_between = 0; - struct __attribute__((visibility("hidden"))) ConflictSet::Impl { void check(const ReadRange *reads, Result *result, int count) { @@ -3369,11 +3362,6 @@ InternalVersionT maxVersion(Node *n, ConflictSet::Impl *impl) { } } -void onPointRead(ConflictSet::Impl *impl) { ++impl->accume_point_read; } -void onPrefixRead(ConflictSet::Impl *impl) { ++impl->accume_prefix_read; } -void onRangeRead(ConflictSet::Impl *impl) { ++impl->accume_range_read; } -void onCheckMaxBetween(ConflictSet::Impl *impl) { ++impl->accume_max_between; } - void setMaxVersion(Node *n, ConflictSet::Impl *impl, InternalVersionT newMax) { int index = n->parentsIndex; n = n->parent;