Go to the documentation of this file. 1 #ifndef HALIDE_INTRUSIVE_PTR_H
2 #define HALIDE_INTRUSIVE_PTR_H
20 std::atomic<int> count;
155 std::swap(
ptr, other.ptr);
162 return ptr !=
nullptr;
HALIDE_ALWAYS_INLINE IntrusivePtr()=default
bool is_const_zero() const
IntrusivePtr< T > & operator=(IntrusivePtr< T > &&other) noexcept
HALIDE_ALWAYS_INLINE IntrusivePtr(T *p)
HALIDE_ALWAYS_INLINE IntrusivePtr(IntrusivePtr< T > &&other) noexcept
Intrusive shared pointers have a reference count (a RefCount object) stored in the class itself.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
RefCount & ref_count(const T *t) noexcept
Because in this header we don't yet know how client classes store their RefCount (and we don't want t...
#define HALIDE_ALWAYS_INLINE
HALIDE_ALWAYS_INLINE IntrusivePtr(const IntrusivePtr< T > &other) noexcept
IntrusivePtr< T > & operator=(const IntrusivePtr< T > &other)
HALIDE_ALWAYS_INLINE bool operator<(const IntrusivePtr< T > &other) const
T * get() const
Access the raw pointer in a variety of ways.
HALIDE_ALWAYS_INLINE bool defined() const
A class representing a reference count to be used with IntrusivePtr.
HALIDE_ALWAYS_INLINE bool same_as(const IntrusivePtr &other) const