Gainput
v1.0.0

An allocator that tracks an allocations that were done. More...
#include <GainputAllocator.h>
Public Member Functions  
TrackingAllocator (Allocator &backingAllocator, Allocator &internalAllocator=GetDefaultAllocator())  
void *  Allocate (size_t size, size_t align=DefaultAlign) 
Allocates a number of bytes and returns a pointer to the allocated memory. More...  
void  Deallocate (void *ptr) 
Deallocates the given memory. More...  
size_t  GetAllocateCount () const 
size_t  GetDeallocateCount () const 
size_t  GetAllocatedMemory () const 
Public Member Functions inherited from gainput::Allocator  
template<class T >  
T *  New () 
An operator newlike function that allocates memory and calls T's constructor. More...  
template<class T , class P0 >  
T *  New (P0 &p0) 
An operator newlike function that allocates memory and calls T's constructor with one parameter. More...  
template<class T , class P0 >  
T *  New (const P0 &p0) 
An operator newlike function that allocates memory and calls T's constructor with one parameter. More...  
template<class T , class P0 , class P1 >  
T *  New (P0 &p0, P1 &p1) 
An operator newlike function that allocates memory and calls T's constructor with two parameters. More...  
template<class T , class P0 , class P1 >  
T *  New (const P0 &p0, P1 &p1) 
An operator newlike function that allocates memory and calls T's constructor with two parameters. More...  
template<class T , class P0 , class P1 >  
T *  New (P0 &p0, const P1 &p1) 
An operator newlike function that allocates memory and calls T's constructor with two parameters. More...  
template<class T , class P0 , class P1 , class P2 >  
T *  New (P0 &p0, const P1 &p1, const P2 &p2) 
An operator newlike function that allocates memory and calls T's constructor with the given parameters. More...  
template<class T , class P0 , class P1 , class P2 >  
T *  New (P0 &p0, const P1 &p1, P2 &p2) 
An operator newlike function that allocates memory and calls T's constructor with the given parameters. More...  
template<class T , class P0 , class P1 , class P2 , class P3 >  
T *  New (P0 &p0, P1 &p1, P2 &p2, P3 &p3) 
An operator newlike function that allocates memory and calls T's constructor with the given parameters. More...  
template<class T , class P0 , class P1 , class P2 , class P3 >  
T *  New (P0 &p0, const P1 &p1, P2 &p2, P3 &p3) 
An operator newlike function that allocates memory and calls T's constructor with the given parameters. More...  
template<class T , class P0 , class P1 , class P2 , class P3 , class P4 >  
T *  New (P0 &p0, P1 &p1, P2 &p2, P3 &p3, P4 &p4) 
An operator newlike function that allocates memory and calls T's constructor with the given parameters. More...  
template<class T , class P0 , class P1 , class P2 , class P3 , class P4 >  
T *  New (P0 &p0, const P1 &p1, P2 &p2, P3 &p3, P4 &p4) 
An operator newlike function that allocates memory and calls T's constructor with the given parameters. More...  
template<class T >  
void  Delete (T *ptr) 
An operator deletelike function that calls ptr's constructor and deallocates the memory. More...  
Additional Inherited Members  
Public Types inherited from gainput::Allocator  
enum  { DefaultAlign = 0 } 
An allocator that tracks an allocations that were done.
Any allocation/deallocation calls are simply forwarded to malloc
and free
. Any requested alignment is ignored.

virtual 
Allocates a number of bytes and returns a pointer to the allocated memory.
size  The number of bytes to allocate. 
Implements gainput::Allocator.

virtual 
Deallocates the given memory.
ptr  The memory block to deallocate. 
Implements gainput::Allocator.