template<bool Shared, class Allocator, unsigned Flags = alb::StatsOptions::All>
class alb::v_100::allocator_with_stats_base< Shared, Allocator, Flags >
This Allocator serves as a facade in front of the specified allocator to collect statistics during runtime about all operations done on this instance. This is an implementation that is not intended to be used in a shared environment when statistics for file, line or time is enabled
In case that caller information shall be collected, the Allocator parameter is encapsulated with an ALB::affix_allocator. In this case alb::allocator_with_stats::AllocationInfo is in used as Prefix and so all caller information is prepended to every allocated block. Be aware that collecting of caller informations adds on top of each allocation sizeof(AllocatorWithStats::AllocationInfo) bytes! With a good optimizing compiler only the code for the enabled statistic information is created.
- Template Parameters
-
Allocator | The allocator that performs all allocations |
Flags | Specifies what kind of statistics get collected |
Definition at line 209 of file allocator_with_stats.hpp.
template<bool Shared, class Allocator, unsigned Flags = alb::StatsOptions::All>
template<typename U = Allocator>
The given block is passed to the underlying Allocator to be expanded This method is only available if the underlying allocator implements it. Depending on the specified Flag, the expand statistic information is stored.
- Parameters
-
b | The block that should be expanded |
delta | The amount of bytes that should be tried to expanded |
- Returns
- True, if the operation was successful
Definition at line 546 of file allocator_with_stats.hpp.
template<bool Shared, class Allocator, unsigned Flags = alb::StatsOptions::All>
template<typename U = Allocator>
The given block is passed to the underlying Allocator to be checked for ownership. This method is only available if the underlying Allocator implements it. Depending on the specified Flag, only the owns statistic information is stored.
- Parameters
-
b | The block its ownership shall be checked |
Definition at line 530 of file allocator_with_stats.hpp.