On 10/8/25 18:06, Richard Henderson wrote:
On 10/8/25 08:27, Paolo Bonzini wrote:
@@ -95,7 +96,7 @@ void qobject_destroy(QObject *obj);
  static inline void qobject_unref_impl(QObject *obj)
  {
      assert(!obj || obj->base.refcnt);
-    if (obj && --obj->base.refcnt == 0) {
+    if (obj && qatomic_fetch_dec(&obj->base.refcnt) == 1) {

qatomic_dec_fetch lets you compare against 0, which makes all isa's happier.

Happy to change all fetch_decs to dec_fetches, but wouldn't the compiler be able to change one to the other?

Otherwise,
Reviewed-by: Richard Henderson <[email protected]>

Thanks!

Paolo


Reply via email to