Sequoia
|
Wraps allocation_info, together with the prior allocation count. More...
#include <AllocationCheckersDetails.hpp>
Public Types | |
using | value_type = T |
using | alloc_info = allocation_info< T, Getter > |
using | predictions_type = typename alloc_info::predictions_type |
using | allocator_type = typename alloc_info::allocator_type |
Public Member Functions | |
allocation_checker (alloc_info i, const int priorCount=0) | |
allocation_checker (alloc_info i, const T &x) | |
template<test_mode Mode, auto Event> | |
bool | check (std::string_view detail, test_logger< Mode > &logger, const T &container, const alloc_prediction< Event > prediction) const |
const alloc_info & | info () const noexcept |
Wraps allocation_info, together with the prior allocation count.
Consider a container, x, on which some potentially allocating operation is performed. Prior to this operation, an instantiation of the allocation_checker class template acquires the number of allocations already performed. Calling the check method after the operation of interest, the container is inspected via the function object stored in allocation_info. This allows the change in the number of allocations to be computed, which is then compared with the prediction.