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:
@@ -3,10 +3,10 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/Config.hpp>
|
||||
#if NAZARA_CORE_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#define NAZARA_DEBUG_MEMORYMANAGER_DISABLE_REDEFINITION
|
||||
#include <Nazara/Core/Debug/MemoryManager.hpp>
|
||||
#include <new>
|
||||
#if NAZARA_CORE_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_CORE_MANAGE_MEMORY
|
||||
36
src/Nazara/Core/Debug/NewRedefinition.cpp
Normal file
36
src/Nazara/Core/Debug/NewRedefinition.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Core module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/Config.hpp>
|
||||
#if NAZARA_CORE_MANAGE_MEMORY
|
||||
|
||||
#define NAZARA_DEBUG_NEWREDEFINITION_DISABLE_REDEFINITION
|
||||
|
||||
#include <Nazara/Core/Debug/NewRedefinition.hpp>
|
||||
#include <Nazara/Core/MemoryManager.hpp>
|
||||
#include <new> // Nécessaire ?
|
||||
|
||||
void* operator new(std::size_t size, const char* file, unsigned int line)
|
||||
{
|
||||
return NzMemoryManager::Allocate(size, false, file, line);
|
||||
}
|
||||
|
||||
void* operator new[](std::size_t size, const char* file, unsigned int line)
|
||||
{
|
||||
return NzMemoryManager::Allocate(size, true, file, line);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr, const char* file, unsigned int line) noexcept
|
||||
{
|
||||
NzMemoryManager::NextFree(file, line);
|
||||
NzMemoryManager::Free(ptr, false);
|
||||
}
|
||||
|
||||
void operator delete[](void* ptr, const char* file, unsigned int line) noexcept
|
||||
{
|
||||
NzMemoryManager::NextFree(file, line);
|
||||
NzMemoryManager::Free(ptr, true);
|
||||
}
|
||||
|
||||
#endif // NAZARA_CORE_MANAGE_MEMORY
|
||||
@@ -2,9 +2,7 @@
|
||||
// This file is part of the "Nazara Engine - Core module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#define NAZARA_DEBUG_MEMORYMANAGER_DISABLE_REDEFINITION
|
||||
|
||||
#include <Nazara/Core/Debug/MemoryManager.hpp>
|
||||
#include <Nazara/Core/MemoryManager.hpp>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
@@ -259,25 +257,3 @@ void NzMemoryManager::Uninitialize()
|
||||
|
||||
std::fclose(log);
|
||||
}
|
||||
|
||||
void* operator new(std::size_t size, const char* file, unsigned int line)
|
||||
{
|
||||
return NzMemoryManager::Allocate(size, false, file, line);
|
||||
}
|
||||
|
||||
void* operator new[](std::size_t size, const char* file, unsigned int line)
|
||||
{
|
||||
return NzMemoryManager::Allocate(size, true, file, line);
|
||||
}
|
||||
|
||||
void operator delete(void* ptr, const char* file, unsigned int line) noexcept
|
||||
{
|
||||
NzMemoryManager::NextFree(file, line);
|
||||
NzMemoryManager::Free(ptr, false);
|
||||
}
|
||||
|
||||
void operator delete[](void* ptr, const char* file, unsigned int line) noexcept
|
||||
{
|
||||
NzMemoryManager::NextFree(file, line);
|
||||
NzMemoryManager::Free(ptr, true);
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
// Notre utilisation du placement new n'est pas (encore ?) compatible avec les définitions du MLT
|
||||
#define NAZARA_DEBUG_MEMORYMANAGER_DISABLE_REDEFINITION
|
||||
#define NAZARA_DEBUG_NEWREDEFINITION_DISABLE_REDEFINITION
|
||||
|
||||
#include <Nazara/Core/ParameterList.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
|
||||
@@ -3930,7 +3930,7 @@ int NzString::Compare(const NzString& first, const NzString& second)
|
||||
NzString NzString::Number(float number)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss.precision(NAZARA_CORE_REAL_PRECISION);
|
||||
oss.precision(NAZARA_CORE_DECIMAL_DIGITS);
|
||||
oss << number;
|
||||
|
||||
return NzString(oss.str());
|
||||
@@ -3939,7 +3939,7 @@ NzString NzString::Number(float number)
|
||||
NzString NzString::Number(double number)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss.precision(NAZARA_CORE_REAL_PRECISION);
|
||||
oss.precision(NAZARA_CORE_DECIMAL_DIGITS);
|
||||
oss << number;
|
||||
|
||||
return NzString(oss.str());
|
||||
@@ -3948,7 +3948,7 @@ NzString NzString::Number(double number)
|
||||
NzString NzString::Number(long double number)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss.precision(NAZARA_CORE_REAL_PRECISION);
|
||||
oss.precision(NAZARA_CORE_DECIMAL_DIGITS);
|
||||
oss << number;
|
||||
|
||||
return NzString(oss.str());
|
||||
|
||||
Reference in New Issue
Block a user