From bd22b47d5ff2f29a10a7f421813a953281cbd836 Mon Sep 17 00:00:00 2001 From: Jens Alfke Date: Thu, 18 Jun 2026 10:03:42 -0700 Subject: [PATCH 1/2] Fixed a compile error in CI on Ubuntu+Clang --- Tests/SupportTests.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); From 33c458a47272e8ab6b1ed364d41d6a6bec19f96d Mon Sep 17 00:00:00 2001 From: Jens Alfke Date: Thu, 18 Jun 2026 15:02:35 -0700 Subject: [PATCH 2/2] AtomicRetained fix for 32-bit(!) CPUs --- Fleece/Support/RefCounted.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)