#include <memory_tracker.h>
Classes | |
struct | AllocationInfo |
Public Member Functions | |
void | TrackAllocation (const void *ptr, size_t size, const char *type) |
void | TrackDeallocation (const void *ptr) |
size_t | GetTotalAllocated () const |
void | DumpAllocations () const |
bool | IsFreed (const void *ptr) const |
Static Public Member Functions | |
static MemoryTracker & | GetInstance () |
Private Member Functions | |
MemoryTracker ()=default | |
Private Attributes | |
std::unordered_map< const void *, AllocationInfo > | allocations_ |
size_t | total_allocated_ = 0 |
std::mutex | mutex_ |
Definition at line 14 of file memory_tracker.h.
|
privatedefault |
Referenced by GetInstance().
|
inlinestatic |
Definition at line 16 of file memory_tracker.h.
References MemoryTracker().
Referenced by yaze::gfx::AllocateSurface(), yaze::gfx::AllocateTexture(), yaze::core::SDL_Surface_Deleter::operator()(), and yaze::core::SDL_Texture_Deleter::operator()().
|
inline |
Definition at line 21 of file memory_tracker.h.
References allocations_, mutex_, and total_allocated_.
Referenced by yaze::gfx::AllocateSurface(), and yaze::gfx::AllocateTexture().
|
inline |
Definition at line 27 of file memory_tracker.h.
References allocations_, mutex_, and total_allocated_.
Referenced by yaze::core::SDL_Surface_Deleter::operator()(), and yaze::core::SDL_Texture_Deleter::operator()().
|
inline |
Definition at line 36 of file memory_tracker.h.
References mutex_, and total_allocated_.
|
inline |
Definition at line 41 of file memory_tracker.h.
References allocations_, mutex_, and total_allocated_.
|
inline |
Definition at line 57 of file memory_tracker.h.
References allocations_, and mutex_.
|
private |
Definition at line 70 of file memory_tracker.h.
Referenced by DumpAllocations(), IsFreed(), TrackAllocation(), and TrackDeallocation().
|
private |
Definition at line 71 of file memory_tracker.h.
Referenced by DumpAllocations(), GetTotalAllocated(), TrackAllocation(), and TrackDeallocation().
|
mutableprivate |
Definition at line 72 of file memory_tracker.h.
Referenced by DumpAllocations(), GetTotalAllocated(), IsFreed(), TrackAllocation(), and TrackDeallocation().