C/C++ API Reference
Loading...
Searching...
No Matches
pw::Deallocator Class Reference

Overview

Abstract interface for releasing memory.

Inheritance diagram for pw::Deallocator:
pw::Allocator pw::allocator::Pool pw::allocator::SynchronizedAllocator< pw::sync::Mutex > pw::allocator::TrackingAllocator< internal::AllMetrics > pw::allocator::test::AllocatorForTest< 1024 > pw::allocator::BuddyAllocator< kMinOuterSize_, kNumBuckets > pw::allocator::BumpAllocator pw::allocator::FallbackAllocator pw::allocator::LibCAllocator pw::allocator::NullAllocator pw::allocator::SynchronizedAllocator< LockType > pw::allocator::TrackingAllocator< MetricsType > pw::allocator::internal::GenericBlockAllocator pw::allocator::internal::GenericGuardedAllocator pw::allocator::test::AllocatorForTest< kBufferSize, BlockType_, MetricsType > pw::allocator::test::FaultInjectingAllocator pw::allocator::AllocatorAsPool pw::allocator::AsyncPool pw::allocator::ChunkPool

Public Types

using Capabilities = allocator::Capabilities
 
using Capability = allocator::Capability
 
using Layout = allocator::Layout
 

Public Member Functions

constexpr const Capabilitiescapabilities () const
 
bool HasCapability (Capability capability) const
 Returns whether a given capability is enabled for this object.
 
void Deallocate (void *ptr)
 
void Deallocate (void *ptr, Layout layout)
 
template<typename ElementType >
void DeleteArray (ElementType *ptr, size_t count)
 
StatusWithSize GetCapacity () const
 
bool IsEqual (const Deallocator &other) const
 
template<typename T , int &... kExplicitGuard, std::enable_if_t<!std::is_array_v< T >, int > = 0>
void Delete (T *ptr)
 
template<typename T , int &... kExplicitGuard, typename ElementType = std::remove_extent_t<T>, std::enable_if_t< is_bounded_array_v< T >, int > = 0>
void Delete (ElementType *ptr)
 
template<typename T , int &... kExplicitGuard, typename ElementType = std::remove_extent_t<T>, std::enable_if_t< is_unbounded_array_v< T >, int > = 0>
void Delete (ElementType *ptr, size_t count)
 

Protected Member Functions

constexpr Deallocator ()=default
 TODO(b/326509341): Remove when downstream consumers migrate.
 
constexpr Deallocator (const Capabilities &capabilities)
 
template<typename T , int &... kExplicitGuard, typename ElementType = std::remove_extent_t<T>, std::enable_if_t< is_unbounded_array_v< T >, int > = 0>
UniquePtr< T > WrapUnique (ElementType *ptr, size_t size)
 

Static Protected Attributes

template<typename T >
static constexpr bool is_bounded_array_v
 
template<typename T >
static constexpr bool is_unbounded_array_v
 

The documentation for this class was generated from the following file: