![]() |
Raven Engine v0.1
|
Classes | |
| struct | AllocationInfo |
| Struct to hold memory allocation information. More... | |
Functions | |
| void | AddAllocation (void *ptr, usize size, const char *function) |
| Mutex for thread-safety when accessing the allocation map. | |
| void | RemoveAllocation (void *ptr) |
| Remove a memory allocation from the tracker. | |
| void | DumpLeaks () |
| Dump memory leaks, if any. | |
Variables | |
| std::unordered_map< void *, AllocationInfo > | s_Allocations |
| std::mutex | s_Mutex |
| Global map tracking allocations. | |
|
inline |
Mutex for thread-safety when accessing the allocation map.
Add a memory allocation to the tracker.
Adds information about an allocated memory block to the global memory tracker.
| ptr | Pointer to the allocated memory. |
| size | Size of the allocated memory in bytes. |
| function | The function from which the allocation was made. |
|
inline |
Dump memory leaks, if any.
Logs any memory that was allocated but not freed, indicating potential memory leaks.
|
inline |
Remove a memory allocation from the tracker.
Removes the given memory allocation from the tracker and logs the deallocation.
| ptr | Pointer to the memory being freed. |
|
inline |
|
inline |
Global map tracking allocations.