Remove anon namespaces (not needed with visibility=hidden)
This commit is contained in:
@@ -93,7 +93,6 @@ Arena::Arena(int initialSize) : impl(nullptr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
void onDestroy(Arena::ArenaImpl *impl) {
|
void onDestroy(Arena::ArenaImpl *impl) {
|
||||||
while (impl) {
|
while (impl) {
|
||||||
auto *prev = impl->prev;
|
auto *prev = impl->prev;
|
||||||
@@ -101,7 +100,6 @@ void onDestroy(Arena::ArenaImpl *impl) {
|
|||||||
impl = prev;
|
impl = prev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace
|
|
||||||
|
|
||||||
Arena::Arena(Arena &&other) noexcept
|
Arena::Arena(Arena &&other) noexcept
|
||||||
: impl(std::exchange(other.impl, nullptr)) {}
|
: impl(std::exchange(other.impl, nullptr)) {}
|
||||||
@@ -429,6 +427,36 @@ uint32_t Arbitrary::bounded(uint32_t s) {
|
|||||||
|
|
||||||
// ==================== END ARBITRARY IMPL ====================
|
// ==================== END ARBITRARY IMPL ====================
|
||||||
|
|
||||||
|
// ==================== BEGIN UTILITIES IMPL ====================
|
||||||
|
|
||||||
|
// Call Stepwise::step for each element of remaining until it returns true.
|
||||||
|
// Applies a permutation to `remaining` as a side effect.
|
||||||
|
template <class Stepwise> void runInterleaved(std::span<Stepwise> remaining) {
|
||||||
|
while (remaining.size() > 0) {
|
||||||
|
for (int i = 0; i < int(remaining.size());) {
|
||||||
|
bool done = remaining[i].step();
|
||||||
|
if (done) {
|
||||||
|
if (i != int(remaining.size()) - 1) {
|
||||||
|
using std::swap;
|
||||||
|
swap(remaining[i], remaining.back());
|
||||||
|
}
|
||||||
|
remaining = remaining.subspan(0, remaining.size() - 1);
|
||||||
|
} else {
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class Stepwise> void runSequential(std::span<Stepwise> remaining) {
|
||||||
|
for (auto &r : remaining) {
|
||||||
|
while (!r.step()) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== END UTILITIES IMPL ====================
|
||||||
|
|
||||||
#define SHOW_PRIORITY 0
|
#define SHOW_PRIORITY 0
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
|
|
||||||
@@ -440,7 +468,6 @@ static auto operator<=>(const Key &lhs, const Key &rhs) {
|
|||||||
return c != 0 ? c <=> 0 : lhs.len <=> rhs.len;
|
return c != 0 ? c <=> 0 : lhs.len <=> rhs.len;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
// A node in the tree representing write conflict history. This tree maintains
|
// A node in the tree representing write conflict history. This tree maintains
|
||||||
// several invariants:
|
// several invariants:
|
||||||
|
|
||||||
@@ -519,32 +546,6 @@ struct Iterator {
|
|||||||
int cmp;
|
int cmp;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Call Stepwise::step for each element of remaining until it returns true.
|
|
||||||
// Applies a permutation to `remaining` as a side effect.
|
|
||||||
template <class Stepwise> void runInterleaved(std::span<Stepwise> remaining) {
|
|
||||||
while (remaining.size() > 0) {
|
|
||||||
for (int i = 0; i < int(remaining.size());) {
|
|
||||||
bool done = remaining[i].step();
|
|
||||||
if (done) {
|
|
||||||
if (i != int(remaining.size()) - 1) {
|
|
||||||
using std::swap;
|
|
||||||
swap(remaining[i], remaining.back());
|
|
||||||
}
|
|
||||||
remaining = remaining.subspan(0, remaining.size() - 1);
|
|
||||||
} else {
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class Stepwise> void runSequential(std::span<Stepwise> remaining) {
|
|
||||||
for (auto &r : remaining) {
|
|
||||||
while (!r.step()) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct StepwiseLastLeq {
|
struct StepwiseLastLeq {
|
||||||
Node *current;
|
Node *current;
|
||||||
Node *result;
|
Node *result;
|
||||||
@@ -878,8 +879,6 @@ bool checkCorrectness(Node *node, ReferenceImpl &refImpl) {
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
struct __attribute__((__visibility__("hidden"))) ConflictSet::Impl {
|
struct __attribute__((__visibility__("hidden"))) ConflictSet::Impl {
|
||||||
Random rand;
|
Random rand;
|
||||||
Node *root;
|
Node *root;
|
||||||
@@ -1134,7 +1133,6 @@ namespace std {
|
|||||||
void __throw_length_error(const char *) { __builtin_unreachable(); }
|
void __throw_length_error(const char *) { __builtin_unreachable(); }
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
||||||
namespace {
|
|
||||||
struct ReferenceImpl {
|
struct ReferenceImpl {
|
||||||
explicit ReferenceImpl(int64_t oldestVersion) : oldestVersion(oldestVersion) {
|
explicit ReferenceImpl(int64_t oldestVersion) : oldestVersion(oldestVersion) {
|
||||||
writeVersionMap[""] = oldestVersion;
|
writeVersionMap[""] = oldestVersion;
|
||||||
@@ -1201,7 +1199,6 @@ struct ReferenceImpl {
|
|||||||
int64_t oldestVersion;
|
int64_t oldestVersion;
|
||||||
std::map<std::string, int64_t> writeVersionMap;
|
std::map<std::string, int64_t> writeVersionMap;
|
||||||
};
|
};
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#ifdef ENABLE_TESTS
|
#ifdef ENABLE_TESTS
|
||||||
int main(void) {
|
int main(void) {
|
||||||
|
Reference in New Issue
Block a user