7#ifndef FLUTTER_FML_MEMORY_REF_COUNTED_INTERNAL_H_
8#define FLUTTER_FML_MEMORY_REF_COUNTED_INTERNAL_H_
12#include "flutter/fml/logging.h"
13#include "flutter/fml/macros.h"
26 ref_count_.fetch_add(1u, std::memory_order_relaxed);
30 return ref_count_.load(std::memory_order_acquire) == 1u;
45 FML_DCHECK(ref_count_.load(std::memory_order_acquire) != 0u);
58 if (ref_count_.fetch_sub(1u, std::memory_order_release) == 1u) {
59 std::atomic_thread_fence(std::memory_order_acquire);
61 destruction_started_ =
true;
71 adoption_required_ =
false;
76 mutable std::atomic_uint_fast32_t ref_count_;
79 mutable bool adoption_required_ =
false;
80 mutable bool destruction_started_ =
false;
90 adoption_required_(
true)
RefCountedThreadSafeBase()
void AssertHasOneRef() const
~RefCountedThreadSafeBase()
#define FML_DCHECK(condition)