Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. C/C++
  4. Memory & storage
  5. pw_allocator
  6. Concrete allocators
  7. pw::allocator::AbstractPool Class Reference
Loading...
Searching...
No Matches
pw::allocator::AbstractPool Class Reference

Overview

A memory pool that provides default implementations for optional methods.

This type isn't instantiated directly, but is provided to make it easier to define other pool types.

Inheritance diagram for pw::allocator::AbstractPool:
pw::allocator::internal::BasicAbstractDeallocator< Pool > pw::allocator::Pool pw::Deallocator pw::allocator::AllocatorAsPool pw::allocator::ChunkPool pw::allocator::TypedPool< T >

Protected Member Functions

constexpr AbstractPool (const Layout &layout)
 
constexpr AbstractPool (Capabilities capabilities, const Layout &layout)
 
- Protected Member Functions inherited from pw::allocator::internal::BasicAbstractDeallocator< Pool >
Result< Layout > DoGetInfo (typename Base::InfoType, const void *) const override
 
- Protected Member Functions inherited from pw::allocator::Pool
constexpr Pool (const Capabilities &capabilities, const Layout &layout)
 
virtual void * DoAllocate ()=0
 
- Protected Member Functions inherited from pw::Deallocator
constexpr Deallocator ()=default
 TODO(b/326509341): Remove when downstream consumers migrate.
 
constexpr Deallocator (const Capabilities &capabilities)
 
Result< Layout > GetInfo (InfoType info_type, const void *ptr) const
 
Result< Layout > GetRequestedLayout (const void *ptr) const
 
Result< Layout > GetUsableLayout (const void *ptr) const
 
Result< Layout > GetAllocatedLayout (const void *ptr) const
 
bool Recognizes (const void *ptr) const
 
virtual void DoDeallocate (void *ptr)=0
 
virtual Result< Layout > DoGetInfo (InfoType, const void *) const
 

Additional Inherited Members

- Public Types inherited from pw::Deallocator
using Capabilities = allocator::Capabilities
 
using Capability = allocator::Capability
 
using Layout = allocator::Layout
 
- Public Member Functions inherited from pw::allocator::Pool
constexpr const Layout & layout () const
 
void * Allocate ()
 
template<typename T , int &... kExplicitGuard, typename... Args>
std::enable_if_t<!std::is_array_v< T >, T * > New (Args &&... args)
 
template<typename T , int &... kExplicitGuard, typename ElementType = std::remove_extent_t<T>>
std::enable_if_t< pw::is_bounded_array_v< T >, ElementType * > New ()
 
template<typename T , int &... kExplicitGuard, typename ElementType = std::remove_extent_t<T>>
std::enable_if_t< pw::is_unbounded_array_v< T >, ElementType * > New ()
 
template<typename T , int &... kExplicitGuard, typename... Args>
std::enable_if_t<!std::is_array_v< T >, UniquePtr< T > > MakeUnique (Args &&... args)
 
template<typename T >
std::enable_if_t< pw::is_bounded_array_v< T >, UniquePtr< T > > MakeUnique ()
 
template<typename T >
std::enable_if_t< pw::is_unbounded_array_v< T >, UniquePtr< T > > MakeUnique ()
 
- Public Member Functions inherited from pw::Deallocator
constexpr const Capabilities & capabilities () const
 
constexpr bool HasCapability (Capability capability) const
 Returns whether a given capability is enabled for this object.
 
void Deallocate (void *ptr)
 
template<typename ElementType >
void DeleteArray (ElementType *ptr, size_t count)
 
template<typename ElementType >
void Destroy (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 Types inherited from pw::Deallocator
enum class  InfoType {
  kRequestedLayoutOf , kUsableLayoutOf , kAllocatedLayoutOf , kCapacity ,
  kRecognizes
}
 
- Static Protected Member Functions inherited from pw::Deallocator
static Result< Layout > GetInfo (const Deallocator &deallocator, InfoType info_type, const void *ptr)
 
static Result< Layout > GetRequestedLayout (const Deallocator &deallocator, const void *ptr)
 
static Result< Layout > GetUsableLayout (const Deallocator &deallocator, const void *ptr)
 
static Result< Layout > GetAllocatedLayout (const Deallocator &deallocator, const void *ptr)
 
static bool Recognizes (const Deallocator &deallocator, const void *ptr)
 
- Static Protected Attributes inherited from pw::Deallocator
template<typename T >
static constexpr bool is_bounded_array_v = ::pw::is_bounded_array_v<T>
 
template<typename T >
static constexpr bool is_unbounded_array_v = ::pw::is_unbounded_array_v<T>
 

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