|
Pigweed
|
#include <block_allocator.h>
Public Member Functions | |
| GenericBlockAllocator (const GenericBlockAllocator &)=delete | |
| GenericBlockAllocator & | operator= (const GenericBlockAllocator &)=delete |
| GenericBlockAllocator (GenericBlockAllocator &&)=delete | |
| GenericBlockAllocator & | operator= (GenericBlockAllocator &&)=delete |
Public Member Functions inherited from pw::Allocator | |
| void * | Allocate (Layout layout) |
| template<typename T , int &... ExplicitGuard, typename... Args> | |
| T * | New (Args &&... args) |
| template<typename T , int &... ExplicitGuard, typename... Args> | |
| UniquePtr< T > | MakeUnique (Args &&... args) |
| bool | Resize (void *ptr, size_t new_size) |
| bool | Resize (void *ptr, Layout layout, size_t new_size) |
| void * | Reallocate (void *ptr, Layout new_layout) |
| void * | Reallocate (void *ptr, Layout old_layout, size_t new_size) |
| allocator::AsPmrAllocator | as_pmr () |
Public Member Functions inherited from pw::Deallocator | |
| const Capabilities & | capabilities () const |
| bool | HasCapability (Capability capability) const |
| Returns whether a given capabilityis enabled for this object. | |
| void | Deallocate (void *ptr) |
| void | Deallocate (void *ptr, Layout layout) |
| template<typename T > | |
| void | Delete (T *ptr) |
| StatusWithSize | GetCapacity () const |
| bool | IsEqual (const Deallocator &other) const |
Static Public Attributes | |
| static constexpr Capabilities | kCapabilities |
Static Protected Member Functions | |
| static void | CrashOnAllocated (void *allocated) |
| static void | CrashOnInvalidFree (void *freed) |
| static void | CrashOnDoubleFree (void *freed) |
| Crashes with an informational message that a given block was freed twice. | |
Additional Inherited Members | |
Public Types inherited from pw::Deallocator | |
| using | Capabilities = allocator::Capabilities |
| using | Capability = allocator::Capability |
| using | Layout = allocator::Layout |
Protected Member Functions inherited from pw::Allocator | |
| constexpr | Allocator ()=default |
| TODO(b/326509341): Remove when downstream consumers migrate. | |
| constexpr | Allocator (const Capabilities &capabilities) |
Protected Member Functions inherited from pw::Deallocator | |
| constexpr | Deallocator ()=default |
| TODO(b/326509341): Remove when downstream consumers migrate. | |
| constexpr | Deallocator (const Capabilities &capabilities) |
| template<typename T > | |
| UniquePtr< T > | WrapUnique (T *ptr) |
Block-independent base class of BlockAllocator.
This class contains static methods which do not depend on the template parameters of BlockAllocator that are used to determine block/ type. This allows the methods to be defined in a separate source file and use macros that cannot be used in headers, e.g. PW_CHECK.
This class should not be used directly. Instead, use BlockAllocator or one of its specializations.
|
staticprotected |
Crashes with an informational message that a given block is allocated.
This method is meant to be called by SplitFreeListAllocators destructor. There must not be any outstanding allocations from an when it is destroyed.
|
staticprotected |
Crashes with an informational message that a given pointer does not belong to this allocator.
|
staticconstexpr |