diff options
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/memorymanager.cpp | 19 | ||||
-rw-r--r-- | src/resources/memorymanager.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/resources/memorymanager.cpp b/src/resources/memorymanager.cpp index a07aaa750..a88d53b79 100644 --- a/src/resources/memorymanager.cpp +++ b/src/resources/memorymanager.cpp @@ -20,7 +20,12 @@ #include "resources/memorymanager.h" +#include "logger.h" + +#include "resources/resourcemanager.h" + #include <SDL_video.h> +#include <string> #include "debug.h" @@ -49,4 +54,18 @@ void MemoryManager::printMemory(const int level A_UNUSED, const int localSum A_UNUSED, const int childsSum A_UNUSED) { + std::string str(level, ' '); + logger->log("%s%d = %d + %d", + str.c_str(), + localSum + childsSum, + localSum, + childsSum); +} + +void MemoryManager::printAllMemory() +{ + if (!logger) + return; + if (resourceManager) + resourceManager->calcMemory(0); } diff --git a/src/resources/memorymanager.h b/src/resources/memorymanager.h index 88b55e617..658876776 100644 --- a/src/resources/memorymanager.h +++ b/src/resources/memorymanager.h @@ -40,6 +40,8 @@ class MemoryManager final void printMemory(const int level, const int localSum, const int childsSum); + + void printAllMemory(); }; extern MemoryManager memoryManager; |