Big config/debug update
Added config checkers Macro no longer use suffixes Moved MemoryManager to upper directory Renamed *_MEMORYMANAGER to *_MANAGE_MEMORY Renamed AUDIO_STREAMEDBUFFERCOUNT to AUDIO_STREAMED_BUFFER_COUNT Renamed CORE_REAL_PRECISION to CORE_DECIMAL_DIGITS Renamed DEBUG_MEMORYMANAGER_DISABLE_REDEFINITION to DEBUG_NEWREDEFINITION_DISABLE_REDEFINITION Renamed GRAPHICS_MAX_LIGHTPERPASS to GRAPHICS_MAX_LIGHT_PER_PASS Renamed UTILITY_FORCE_DECLARATION_STRIDE_MULTIPLE_OF_32 to UTILITY_VERTEX_DECLARATION_FORCE_STRIDE_MULTIPLE_OF_32 Former-commit-id: 81ef836ac9f092ac471f60e544bb7c7c6370593c
This commit is contained in:
@@ -17,7 +17,7 @@ else
|
||||
end
|
||||
|
||||
if (_OPTIONS["united"]) then
|
||||
excludes "../src/Nazara/ModuleName/Debug/Leaks.cpp"
|
||||
excludes "../src/Nazara/ModuleName/Debug/NewOverload.cpp"
|
||||
else
|
||||
configuration "DebugStatic"
|
||||
links "NazaraCore-s-d"
|
||||
|
||||
@@ -29,10 +29,15 @@
|
||||
|
||||
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||
|
||||
// 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
|
||||
// Utilise le MemoryManager pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
|
||||
#define NAZARA_MODULENAME_MANAGE_MEMORY 0
|
||||
|
||||
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||
#define NAZARA_MODULENAME_SAFE 1
|
||||
|
||||
/// Chaque modification d'un paramètre ci-dessous implique une modification (souvent mineure) du code
|
||||
|
||||
/// Vérification des valeurs et types de certaines constantes
|
||||
#include <Nazara/ModuleName/ConfigCheck.hpp>
|
||||
|
||||
#endif // NAZARA_CONFIG_MODULENAME_HPP
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2014 AUTHORS
|
||||
// This file is part of the "Nazara Engine - Module name"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CONFIG_CHECK_MODULENAME_HPP
|
||||
#define NAZARA_CONFIG_CHECK_MODULENAME_HPP
|
||||
|
||||
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
|
||||
|
||||
#include <type_traits>
|
||||
#define CheckType(name, type, err) static_assert(std::is_ ##type <decltype(name)>::value, #type err)
|
||||
#define CheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
|
||||
|
||||
// On force la valeur de MANAGE_MEMORY en mode debug
|
||||
#if defined(NAZARA_DEBUG) && !NAZARA_MODULENAME_MANAGE_MEMORY
|
||||
#undef NAZARA_MODULENAME_MANAGE_MEMORY
|
||||
#define NAZARA_MODULENAME_MANAGE_MEMORY 1
|
||||
#endif
|
||||
|
||||
#endif // NAZARA_CONFIG_CHECK_MODULENAME_HPP
|
||||
@@ -3,9 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/ModuleName/Config.hpp>
|
||||
#if NAZARA_MODULENAME_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||
|
||||
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||
#define new new(__FILE__, __LINE__)
|
||||
#if NAZARA_MODULENAME_MANAGE_MEMORY
|
||||
#include <Nazara/Core/Debug/NewRedefinition.hpp>
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// 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_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
|
||||
#if NAZARA_MODULENAME_HPP
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/ModuleName/Config.hpp>
|
||||
#if NAZARA_MODULENAME_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#define NAZARA_DEBUG_MEMORYMANAGER_DISABLE_REDEFINITION
|
||||
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||
#include <new>
|
||||
#if NAZARA_MODULENAME_MANAGE_MEMORY
|
||||
|
||||
#include <Nazara/Core/MemoryManager.hpp>
|
||||
#include <new> // Nécessaire ?
|
||||
|
||||
void* operator new(std::size_t size)
|
||||
{
|
||||
@@ -27,4 +27,5 @@ void operator delete[](void* pointer) noexcept
|
||||
{
|
||||
NzMemoryManager::Free(pointer, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // NAZARA_MODULENAME_MANAGE_MEMORY
|
||||
Reference in New Issue
Block a user