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;
173 bool operator<(const IntrusivePtr<T> &other)
const {
174 return ptr < other.ptr;
HALIDE_ALWAYS_INLINE IntrusivePtr(IntrusivePtr< T > &&other) noexcept
IntrusivePtr< T > & operator=(IntrusivePtr< T > &&other) noexcept
Intrusive shared pointers have a reference count (a RefCount object) stored in the class itself...
void destroy(const T *t)
Because in this header we don't yet know how client classes store their RefCount (and we don't want t...
This file defines the class FunctionDAG, which is our representation of a Halide pipeline, and contains methods to using Halide's bounds tools to query properties of it.
T & operator*() const
Access the raw pointer in a variety of ways.
IntrusivePtr< T > & operator=(const IntrusivePtr< T > &other)
This file declares the routines used by Halide internally in its runtime.
T * operator->() const
Access the raw pointer in a variety of ways.
HALIDE_ALWAYS_INLINE IntrusivePtr(T *p)
Not visible externally, similar to 'static' linkage in C.
#define HALIDE_ALWAYS_INLINE
bool is_const_zero() const
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...
HALIDE_ALWAYS_INLINE bool same_as(const IntrusivePtr &other) const
HALIDE_ALWAYS_INLINE IntrusivePtr(const IntrusivePtr< T > &other) noexcept
HALIDE_ALWAYS_INLINE bool defined() const
A class representing a reference count to be used with IntrusivePtr.
HALIDE_ALWAYS_INLINE IntrusivePtr()=default