Allocator Builder
Policy Based C++ Template Allocator Library
 All Classes Functions Variables Enumerations Enumerator Groups Pages
Statistic

Classes

class  alb::v_100::allocator_with_stats_base< Shared, Allocator, Flags >
 
struct  alb::v_100::allocator_with_stats_base< Shared, Allocator, Flags >::AllocationInfo
 
class  alb::v_100::allocator_with_stats_base< Shared, Allocator, Flags >::Allocations
 

Enumerations

enum  alb::v_100::StatsOptions : unsigned {
  alb::v_100::NumOwns = 1u << 0, alb::v_100::NumAllocate = 1u << 1, alb::v_100::NumAllocateOK = 1u << 2, alb::v_100::NumExpand = 1u << 3,
  alb::v_100::NumExpandOK = 1u << 4, alb::v_100::NumReallocate = 1u << 5, alb::v_100::NumReallocateOK = 1u << 6, alb::v_100::NumReallocateInPlace = 1u << 7,
  alb::v_100::NumDeallocate = 1u << 8, alb::v_100::NumDeallocateAll = 1u << 9, alb::v_100::NumAll = (1u << 10) - 1, alb::v_100::BytesAllocated = 1u << 10,
  alb::v_100::BytesDeallocated = 1u << 11, alb::v_100::BytesExpanded = 1u << 12, alb::v_100::BytesContracted = 1u << 13, alb::v_100::BytesMoved = 1u << 14,
  alb::v_100::BytesSlack = 1u << 15, alb::v_100::BytesHighTide = 1u << 16, alb::v_100::BytesAll = ((1u << 17) - 1) & ~NumAll, alb::v_100::CallerSize = 1u << 17,
  alb::v_100::CallerFile = 1u << 18, alb::v_100::CallerFunction = 1u << 19, alb::v_100::CallerLine = 1u << 20, alb::v_100::CallerTime = 1u << 21,
  alb::v_100::CallerAll = ((1u << 22) - 1) & ~NumAll & ~BytesAll, alb::v_100::All = (1u << 22) - 1
}
 

Detailed Description

Enumeration Type Documentation

enum alb::v_100::StatsOptions : unsigned

The following options define what statistics shall be collected during runtime taken from https://github.com/andralex/phobos/blob/allocator/std/allocator.d and adapted to this implementation.

Enumerator
NumOwns 

Counts the number of calls to alb::allocator_with_stats::owns.

NumAllocate 

Counts the number of calls to alb::allocator_with_stats::allocate. All calls are counted, including requests for zero bytes or failed requests.

NumAllocateOK 

Counts the number of calls to alb::allocator_with_stats::allocate that succeeded, i.e. they wherefor more than zero bytes and returned a non-null block.

NumExpand 

Counts the number of calls to alb::allocator_with_stats::expand, regardless of arguments or result.

NumExpandOK 

Counts the number of calls to alb::allocator_with_stats::expand that resulted in a successful expansion.

NumReallocate 

Counts the number of calls to alb::allocator_with_stats::reallocate, regardless of arguments or result.

NumReallocateOK 

Counts the number of calls to alb::allocator_with_stats::reallocate that succeeded. (Reallocations to zero bytes count as successful.)

NumReallocateInPlace 

Counts the number of calls to alb::allocator_with_stats::reallocate that resulted in an in-place reallocation (no memory moved). If this number is close to the total number of reallocations, that indicates the allocator finds room at the current block's end in a large fraction of the cases, but also that internal fragmentation may be high (the size of the unit of allocation is large compared to the typical allocation size of the application).

NumDeallocate 

Counts the number of calls to alb::allocator_with_stats::deallocate.

NumDeallocateAll 

Counts the number of calls to alb::allocator_with_stats::deallocate_all.

NumAll 

Chooses all numXxx)flags.

BytesAllocated 

Tracks total cumulative bytes allocated by means of alb::allocator_with_stats::allocate, alb::allocator_with_stats::expand, and alb::allocator_with_stats::reallocate (when resulting in an expansion). This number always grows and indicates allocation traffic. To compute bytes currently allocated, subtract alb::allocator_with_stats::bytesDeallocated (below) from alb::allocator_with_stats::bytesAllocated.

BytesDeallocated 

Tracks total cumulative bytes deallocated by means of alb::allocator_with_stats::deallocate and alb::allocator_with_stats::reallocate (when resulting in a contraction). This number always grows and indicates deallocation traffic.

BytesExpanded 

Tracks the sum of all delta values in calls of the form alb::allocator_with_stats::expand(b, delta)) that succeed.

BytesContracted 

Tracks the sum of all (b.length - s) with (b.length > s) in calls of the form alb::allocator_with_stats::reallocate(b, s)) that succeed.

BytesMoved 

Tracks the sum of all bytes moved as a result of calls to alb::allocator_with_stats::reallocate that were unable to reallocate in place. A large number (relative to bytesAllocated)) indicates that the application should use larger preallocations.

BytesSlack 

Measures the sum of extra bytes allocated beyond the bytes requested, i.e. the http://goo.gl/YoKffF, internal fragmentation). This is the current effective number of slack bytes, and it goes up and down with time.

BytesHighTide 

Measures the maximum bytes allocated over the time. This is useful for dimensioning allocators.

BytesAll 

Chooses all byteXxx flags.

CallerSize 

Instructs AllocatorWithStats to store the size asked by the caller for each allocation. All per-allocation data is stored just before the actually allocation by using an affix_allocator.

CallerFile 

Instructs AllocatorWithStats to store the caller's file for each allocation.

CallerFunction 

Instructs AllocatorWithStats to store the caller function name for each allocation.

CallerLine 

Instructs AllocatorWithStats to store the caller's line for each allocation.

CallerTime 

Instructs AllocatorWithStats to store the time of each allocation.

CallerAll 

Chooses all callerXxx flags.

All 

Combines all flags above.

Definition at line 44 of file allocator_with_stats.hpp.