Pigweed
 
Loading...
Searching...
No Matches
pw::allocator::NoMetrics Struct Reference

#include <metrics.h>

Inheritance diagram for pw::allocator::NoMetrics:
pw::allocator::internal::AllMetrics

Public Member Functions

::pw::StatusWithSize get_requested_bytes () const
 
::pw::StatusWithSize get_peak_requested_bytes () const
 
::pw::StatusWithSize get_cumulative_requested_bytes () const
 
::pw::StatusWithSize get_allocated_bytes () const
 
::pw::StatusWithSize get_peak_allocated_bytes () const
 
::pw::StatusWithSize get_cumulative_allocated_bytes () const
 
::pw::StatusWithSize get_num_allocations () const
 
::pw::StatusWithSize get_num_deallocations () const
 
::pw::StatusWithSize get_num_resizes () const
 
::pw::StatusWithSize get_num_reallocations () const
 
::pw::StatusWithSize get_num_free_blocks () const
 
::pw::StatusWithSize get_smallest_free_block_size () const
 
::pw::StatusWithSize get_largest_free_block_size () const
 
::pw::StatusWithSize get_num_failures () const
 
::pw::StatusWithSize get_unfulfilled_bytes () const
 
void UpdateDeferred (Allocator &)
 

Static Public Member Functions

static constexpr bool has_requested_bytes ()
 
static constexpr bool requested_bytes_enabled ()
 
static constexpr bool has_peak_requested_bytes ()
 
static constexpr bool peak_requested_bytes_enabled ()
 
static constexpr bool has_cumulative_requested_bytes ()
 
static constexpr bool cumulative_requested_bytes_enabled ()
 
static constexpr bool has_allocated_bytes ()
 
static constexpr bool allocated_bytes_enabled ()
 
static constexpr bool has_peak_allocated_bytes ()
 
static constexpr bool peak_allocated_bytes_enabled ()
 
static constexpr bool has_cumulative_allocated_bytes ()
 
static constexpr bool cumulative_allocated_bytes_enabled ()
 
static constexpr bool has_num_allocations ()
 
static constexpr bool num_allocations_enabled ()
 
static constexpr bool has_num_deallocations ()
 
static constexpr bool num_deallocations_enabled ()
 
static constexpr bool has_num_resizes ()
 
static constexpr bool num_resizes_enabled ()
 
static constexpr bool has_num_reallocations ()
 
static constexpr bool num_reallocations_enabled ()
 
static constexpr bool has_num_free_blocks ()
 
static constexpr bool num_free_blocks_enabled ()
 
static constexpr bool has_smallest_free_block_size ()
 
static constexpr bool smallest_free_block_size_enabled ()
 
static constexpr bool has_largest_free_block_size ()
 
static constexpr bool largest_free_block_size_enabled ()
 
static constexpr bool has_num_failures ()
 
static constexpr bool num_failures_enabled ()
 
static constexpr bool has_unfulfilled_bytes ()
 
static constexpr bool unfulfilled_bytes_enabled ()
 

Detailed Description

A predefined metric struct that enables no allocator metrics.

This struct declares all valid metrics, but enables none of them. Other metrics struct MUST derive from this type, and should use PW_ALLOCATOR_METRICS_INCLUDE and/or PW_ALLOCATOR_METRICS_ENABLE.

Member Function Documentation

◆ UpdateDeferred()

void pw::allocator::NoMetrics::UpdateDeferred ( Allocator )
inline

Updates metrics by querying an allocator directly.

Metrics are typically updated by an allocator when the pw::Allocator API is invoked. In some cases, there may be metrics that cannot be determined at the interface or are too expensive to do so, e.g. determining the smallest free block. This method provides a way for metrics structs to request these values on-demand.

For this empty base struct, this is simply a no-op.


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