diff --git a/Fleece/Support/RefCounted.cc b/Fleece/Support/RefCounted.cc index 93ee9ce0..72185e98 100644 --- a/Fleece/Support/RefCounted.cc +++ b/Fleece/Support/RefCounted.cc @@ -136,7 +136,7 @@ namespace fleece { namespace internal { /// Tag bit that's added to `_ref` while accessing it. /// We can't use the low bit (1) because mutable Fleece Values already use that as a tag. - static constexpr uintptr_t kBusyMask = uintptr_t(1) << 63; + static constexpr uintptr_t kBusyMask = uintptr_t(1) << (8 * sizeof(uintptr_t) - 1); AtomicWrapper::AtomicWrapper(uintptr_t ref) noexcept :_ref(ref) diff --git a/Tests/SupportTests.cc b/Tests/SupportTests.cc index 2acff0bb..a27f368b 100644 --- a/Tests/SupportTests.cc +++ b/Tests/SupportTests.cc @@ -473,7 +473,7 @@ struct AtomicRetainedTest : RefCounted { TEST_CASE("AtomicRetained") { // This is mostly to check for compile errors. - AtomicRef r = new AtomicRetainedTest(); + AtomicRef r = new AtomicRetainedTest(); CHECK(r->i == 0); AtomicRetained r2 = r; AtomicRetained r3 = std::move(r2);