Updated MemoryManager
Renamed MemoryLeakTracker[.hpp|.cpp] to MemoryManager[.hpp|.cpp] Added MemoryManager::GetAllocatedBlockCount() Added MemoryManager::GetAllocatedSize() Optimized MemoryManager (no longer allocates a time buffer) Former-commit-id: 0e9c720cbb48fbed7006db3bd1000ebbc22c9583
This commit is contained in:
@@ -29,8 +29,8 @@
|
||||
|
||||
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||
|
||||
// Utilise un tracker pour repérer les éventuels leaks (Ralentit l'exécution)
|
||||
#define NAZARA_MODULENAME_MEMORYLEAKTRACKER 0
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks, ralenti l'exécution)
|
||||
#define NAZARA_MODULENAME_MEMORYMANAGER 0
|
||||
|
||||
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||
#define NAZARA_MODULENAME_SAFE 1
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/ModuleName/Config.hpp>
|
||||
#if NAZARA_MODULENAME_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||
#if NAZARA_MODULENAME_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||
|
||||
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file is part of the "Nazara Engine - Module name"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#if NAZARA_MODULENAME_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||
#if NAZARA_MODULENAME_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/ModuleName/Config.hpp>
|
||||
#if NAZARA_MODULENAME_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||
#if NAZARA_MODULENAME_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#define NAZARA_DEBUG_MEMORYMANAGER_DISABLE_REDEFINITION
|
||||
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||
#include <new>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user