Nugget
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
CountingAllocator Class Reference

#include <EASTLTest.h>

Inheritance diagram for CountingAllocator:
Inheritance graph
[legend]
Collaboration diagram for CountingAllocator:
Collaboration graph
[legend]

Public Types

using base_type = eastl::allocator
 

Public Member Functions

EASTL_ALLOCATOR_EXPLICIT CountingAllocator (const char *pName=EASTL_NAME_VAL(EASTL_ALLOCATOR_DEFAULT_NAME))
 
 CountingAllocator (const CountingAllocator &x)
 
 CountingAllocator (const CountingAllocator &x, const char *pName)
 
CountingAllocatoroperator= (const CountingAllocator &x)
 
virtual void * allocate (size_t n, int flags=0)
 
virtual void * allocate (size_t n, size_t alignment, size_t offset, int flags=0)
 
void deallocate (void *p, size_t n)
 
const char * get_name () const
 
void set_name (const char *pName)
 
- Public Member Functions inherited from eastl::allocator
EASTL_ALLOCATOR_EXPLICIT allocator (const char *pName=EASTL_NAME_VAL(EASTL_ALLOCATOR_DEFAULT_NAME))
 
 allocator (const allocator &x)
 
 allocator (const allocator &x, const char *pName)
 
allocatoroperator= (const allocator &x)
 
void * allocate (size_t n, int flags=0)
 
void * allocate (size_t n, size_t alignment, size_t offset, int flags=0)
 
void deallocate (void *p, size_t n)
 
const char * get_name () const
 
void set_name (const char *pName)
 

Static Public Member Functions

static auto getTotalAllocationCount ()
 
static auto getTotalAllocationSize ()
 
static auto getActiveAllocationSize ()
 
static auto getActiveAllocationCount ()
 
static auto neverUsed ()
 
static void resetCount ()
 

Static Public Attributes

static uint64_t activeAllocCount = 0
 
static uint64_t totalAllocCount = 0
 
static uint64_t totalDeallocCount = 0
 
static uint64_t totalCtorCount = 0
 
static uint64_t defaultCtorCount = 0
 
static uint64_t copyCtorCount = 0
 
static uint64_t assignOpCount = 0
 
static uint64_t totalAllocatedMemory = 0
 
static uint64_t activeAllocatedMemory = 0
 

Detailed Description

CountingAllocator

Counts allocation events allowing unit tests to validate assumptions.


The documentation for this class was generated from the following files: