1#ifndef HALIDE_INTRUSIVE_PTR_H
2#define HALIDE_INTRUSIVE_PTR_H
20 std::atomic<int> count;
158 std::swap(
ptr, other.ptr);
165 return ptr !=
nullptr;
This file declares the routines used by Halide internally in its runtime.
#define HALIDE_ALWAYS_INLINE
A class representing a reference count to be used with IntrusivePtr.
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...
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
Intrusive shared pointers have a reference count (a RefCount object) stored in the class itself.
HALIDE_ALWAYS_INLINE IntrusivePtr()=default
IntrusivePtr< T > & operator=(IntrusivePtr< T > &&other) noexcept
HALIDE_ALWAYS_INLINE IntrusivePtr(T *p)
HALIDE_ALWAYS_INLINE bool defined() const
HALIDE_ALWAYS_INLINE bool same_as(const IntrusivePtr &other) const
T * get() const
Access the raw pointer in a variety of ways.
HALIDE_ALWAYS_INLINE bool operator<(const IntrusivePtr< T > &other) const
HALIDE_ALWAYS_INLINE IntrusivePtr(const IntrusivePtr< T > &other) noexcept
HALIDE_ALWAYS_INLINE IntrusivePtr(IntrusivePtr< T > &&other) noexcept
HALIDE_ALWAYS_INLINE bool is_sole_reference() const
IntrusivePtr< T > & operator=(const IntrusivePtr< T > &other)