Container System 0.1.0
High-performance C++20 type-safe container framework with SIMD-accelerated serialization
Loading...
Searching...
No Matches
kcenon::container::internal::pool_allocator_stats Struct Reference

Extended pool statistics with hit/miss tracking. More...

#include <pool_allocator.h>

Collaboration diagram for kcenon::container::internal::pool_allocator_stats:
Collaboration graph

Public Member Functions

double hit_rate () const noexcept
 

Public Attributes

std::size_t pool_hits {0}
 
std::size_t pool_misses {0}
 
std::size_t small_pool_allocs {0}
 
std::size_t medium_pool_allocs {0}
 
std::size_t deallocations {0}
 

Detailed Description

Extended pool statistics with hit/miss tracking.

Definition at line 42 of file pool_allocator.h.

Member Function Documentation

◆ hit_rate()

double kcenon::container::internal::pool_allocator_stats::hit_rate ( ) const
inlinenoexcept

Definition at line 49 of file pool_allocator.h.

49 {
50 auto total = pool_hits + pool_misses;
51 return total > 0 ? static_cast<double>(pool_hits) / total : 0.0;
52 }

References pool_hits, and pool_misses.

Member Data Documentation

◆ deallocations

std::size_t kcenon::container::internal::pool_allocator_stats::deallocations {0}

Definition at line 47 of file pool_allocator.h.

47{0}; // Total deallocations

Referenced by kcenon::container::internal::pool_allocator::deallocate().

◆ medium_pool_allocs

std::size_t kcenon::container::internal::pool_allocator_stats::medium_pool_allocs {0}

Definition at line 46 of file pool_allocator.h.

46{0}; // Medium pool allocations

Referenced by kcenon::container::internal::pool_allocator::allocate().

◆ pool_hits

std::size_t kcenon::container::internal::pool_allocator_stats::pool_hits {0}

Definition at line 43 of file pool_allocator.h.

43{0}; // Allocations satisfied from pool

Referenced by kcenon::container::internal::pool_allocator::allocate(), and hit_rate().

◆ pool_misses

std::size_t kcenon::container::internal::pool_allocator_stats::pool_misses {0}

Definition at line 44 of file pool_allocator.h.

44{0}; // Allocations that went to heap

Referenced by kcenon::container::internal::pool_allocator::allocate(), and hit_rate().

◆ small_pool_allocs

std::size_t kcenon::container::internal::pool_allocator_stats::small_pool_allocs {0}

Definition at line 45 of file pool_allocator.h.

45{0}; // Small pool allocations

Referenced by kcenon::container::internal::pool_allocator::allocate().


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