55 while (orig_ptr != old_ptr) {
66 #endif // HAVE_THREADS 70 #ifdef DO_MEMORY_USAGE 78 if (old_ptr !=
nullptr) {
89 reassign((To *)copy._void_ptr);
99 #ifdef DO_MEMORY_USAGE 101 if (type == TypeHandle::none()) {
103 type = get_type_handle(To);
105 if (type != TypeHandle::none()) {
108 #endif // DO_MEMORY_USAGE 129 if (_void_ptr !=
nullptr) {
130 out <<
":" << ((To *)_void_ptr)->get_ref_count();
static Pointer get_ptr(const Pointer &var)
Atomically retrieves the snapshot value of the indicated variable.
void output(std::ostream &out) const
A handy function to output ThreadSafePointerTo's as a hex pointer followed by a reference count.
void clear()
A convenient way to set the ThreadSafePointerTo object to NULL.
This is the base class for ThreadSafePointerTo and ThreadSafeConstPointerTo.
static void update_type(ReferenceCount *ptr, TypeHandle type)
Associates the indicated type with the given pointer.
static bool get_track_memory_usage()
Returns true if the user has Configured the variable 'track-memory-usage' to true,...
TypeHandle is the identifier used to differentiate C++ class types.
void unref_delete(RefCountType *ptr)
This global helper function will unref the given ReferenceCount object, and if the reference count re...
static Pointer compare_and_exchange_ptr(Pointer &mem, Pointer old_value, Pointer new_value)
Atomic compare and exchange.