diff --git a/ConflictSet.cpp b/ConflictSet.cpp index b626797..3fab679 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -820,7 +820,7 @@ void ConflictSet::setOldestVersion(int64_t oldestVersion) { return impl->setOldestVersion(oldestVersion); } -ConflictSet::ConflictSet(int64_t oldestVersion, [[maybe_unused]] uint64_t seed) +ConflictSet::ConflictSet(int64_t oldestVersion) : impl(new (safe_malloc(sizeof(Impl))) Impl{oldestVersion}) {} ConflictSet::~ConflictSet() { @@ -859,7 +859,7 @@ ConflictSet_setOldestVersion(void *cs, int64_t oldestVersion) { ((ConflictSet::Impl *)cs)->setOldestVersion(oldestVersion); } __attribute__((__visibility__("default"))) void * -ConflictSet_create(int64_t oldestVersion, uint64_t) { +ConflictSet_create(int64_t oldestVersion) { return new (safe_malloc(sizeof(ConflictSet::Impl))) ConflictSet::Impl{oldestVersion}; } @@ -870,6 +870,8 @@ __attribute__((__visibility__("default"))) void ConflictSet_destroy(void *cs) { } } +namespace { + void printLogical(std::string &result, Node *node) { Arena arena; for (Node *iter = node; iter != nullptr;) { @@ -982,6 +984,8 @@ bool checkCorrectness(Node *node, ReferenceImpl &refImpl) { return success; } +} // namespace + namespace std { void __throw_length_error(const char *) { __builtin_unreachable(); } } // namespace std diff --git a/Internal.h b/Internal.h index 2a5c0a9..48ba17d 100644 --- a/Internal.h +++ b/Internal.h @@ -448,6 +448,8 @@ inline std::string printable(const Key &key) { return printable(std::string_view((const char *)key.p, key.len)); } +namespace { + template struct TestDriver { // TODO call setOldestVersion, and check range writes/reads Arbitrary arbitrary; @@ -538,5 +540,6 @@ template struct TestDriver { return false; } }; +} // namespace // GCOVR_EXCL_STOP \ No newline at end of file diff --git a/conflict_set_c_api_test.c b/conflict_set_c_api_test.c index d38122a..d593b59 100644 --- a/conflict_set_c_api_test.c +++ b/conflict_set_c_api_test.c @@ -3,7 +3,7 @@ #include int main(void) { - ConflictSet *cs = ConflictSet_create(0, 0); + ConflictSet *cs = ConflictSet_create(0); ConflictSet_WriteRange w; ConflictSet_Result result; ConflictSet_ReadRange r; diff --git a/conflict_set_cxx_api_test.cpp b/conflict_set_cxx_api_test.cpp index 6ad314b..b057dbf 100644 --- a/conflict_set_cxx_api_test.cpp +++ b/conflict_set_cxx_api_test.cpp @@ -3,7 +3,7 @@ #include int main(void) { - ConflictSet cs(0, 0); + ConflictSet cs(0); ConflictSet::WriteRange w; w.begin.p = (const uint8_t *)"0000"; w.begin.len = 4; diff --git a/include/ConflictSet.h b/include/ConflictSet.h index 990155c..d38fda0 100644 --- a/include/ConflictSet.h +++ b/include/ConflictSet.h @@ -52,7 +52,7 @@ struct __attribute__((__visibility__("default"))) ConflictSet { /** Reads where readVersion < oldestVersion will result in `TooOld`. There are * no writes initially. */ - explicit ConflictSet(int64_t oldestVersion, uint64_t seed); + explicit ConflictSet(int64_t oldestVersion); ~ConflictSet(); #if __cplusplus > 199711L @@ -121,7 +121,7 @@ void ConflictSet_addWrites(ConflictSet *cs, void ConflictSet_setOldestVersion(ConflictSet *cs, int64_t oldestVersion); /** Reads where readVersion < oldestVersion will result in `TooOld`. There are * no writes initially. */ -ConflictSet *ConflictSet_create(int64_t oldestVersion, uint64_t seed); +ConflictSet *ConflictSet_create(int64_t oldestVersion); void ConflictSet_destroy(ConflictSet *cs); #endif diff --git a/symbols.txt b/symbols.txt index cc2a9f0..06ea86e 100644 --- a/symbols.txt +++ b/symbols.txt @@ -6,9 +6,9 @@ ConflictSet_setOldestVersion _ZN11ConflictSet16setOldestVersionEl _ZN11ConflictSet9addWritesEPKNS_10WriteRangeEi _ZN11ConflictSetaSEOS_ -_ZN11ConflictSetC1Elm +_ZN11ConflictSetC1El _ZN11ConflictSetC1EOS_ -_ZN11ConflictSetC2Elm +_ZN11ConflictSetC2El _ZN11ConflictSetC2EOS_ _ZN11ConflictSetD1Ev _ZN11ConflictSetD2Ev diff --git a/test_symbols.sh b/test_symbols.sh index 6217cdf..386ad44 100755 --- a/test_symbols.sh +++ b/test_symbols.sh @@ -2,4 +2,5 @@ set -euo pipefail -diff -u <(nm $1 | grep " T " | cut -f3 -d " " | sort) $2 +diff -u "$2" <(nm "$1" | grep " T " | cut -f3 -d " " | sort) +nm "$1" | grep " U " | (! grep -Pv 'abort|free|malloc|mem[a-z]*')