class RefcountAndFlags
Defined at line 140 of file ../../third_party/abseil-cpp/absl/strings/internal/cord_internal.h
Compact class for tracking the reference count and state flags for CordRep
instances. Data is stored in an atomic int32_t for compactness and speed.
Public Methods
void RefcountAndFlags ()
Defined at line 142 of file ../../third_party/abseil-cpp/absl/strings/internal/cord_internal.h
void RefcountAndFlags (Immortal )
Defined at line 144 of file ../../third_party/abseil-cpp/absl/strings/internal/cord_internal.h
void Increment ()
Increments the reference count. Imposes no memory ordering.
Defined at line 147 of file ../../third_party/abseil-cpp/absl/strings/internal/cord_internal.h
bool Decrement ()
Asserts that the current refcount is greater than 0. If the refcount is
greater than 1, decrements the reference count.
Returns false if there are no references outstanding; true otherwise.
Inserts barriers to ensure that state written before this method returns
false will be visible to a thread that just observed this method returning
false. Always returns false when the immortal bit is set.
Defined at line 158 of file ../../third_party/abseil-cpp/absl/strings/internal/cord_internal.h
bool DecrementExpectHighRefcount ()
Same as Decrement but expect that refcount is greater than 1.
Defined at line 167 of file ../../third_party/abseil-cpp/absl/strings/internal/cord_internal.h
size_t Get ()
Returns the current reference count using acquire semantics.
Defined at line 175 of file ../../third_party/abseil-cpp/absl/strings/internal/cord_internal.h
bool IsOne ()
Returns whether the atomic integer is 1.
If the reference count is used in the conventional way, a
reference count of 1 implies that the current thread owns the
reference and no other thread shares it.
This call performs the test for a reference count of one, and
performs the memory barrier needed for the owning thread
to act on the object, knowing that it has exclusive access to the
object. Always returns false when the immortal bit is set.
Defined at line 188 of file ../../third_party/abseil-cpp/absl/strings/internal/cord_internal.h
bool IsImmortal ()
Defined at line 192 of file ../../third_party/abseil-cpp/absl/strings/internal/cord_internal.h