Add Memory debugger

This commit is contained in:
2026-01-04 18:02:45 +01:00
parent 1acecd03ee
commit bed24ff28a
5 changed files with 122 additions and 16 deletions

View File

@@ -10,11 +10,28 @@
#include <amethyst/renderer.hpp>
#include <amethyst/texture.hpp>
#include <amethyst/utils.hpp>
#include <atomic>
namespace Amy {
void RegisterCxxExceptionHandler();
}
void* Malloc(size_t size);
void Free(void* ptr);
namespace Memory {
struct MemMetrics {
std::atomic<ull> Allocated = 0; ///< Total Allocated Memory
std::atomic<ull> Current = 0; ///< Current Allocated Memory
std::atomic<ull> Deleted = 0; ///< Total Deleted Memory
std::atomic<ull> Allocations = 0; ///< Current Allocations count
/// @brief Gets the Currently Allocated Memory
ull CurrentlyAllocated() { return Current; }
};
ull GetTotalAllocated();
ull GetTotalFreed();
ull GetCurrent();
ull GetAllocationCount();
} // namespace Memory
} // namespace Amy
using Iron = Amy::Iron;
using C3D = Amy::C3D;
using GTrace = Amy::GTrace;
using GTrace = Amy::GTrace;