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:
@@ -1,44 +0,0 @@
|
||||
// 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
|
||||
|
||||
#ifndef NAZARA_DEBUG_MEMORYMANAGER_HPP
|
||||
#define NAZARA_DEBUG_MEMORYMANAGER_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
class NAZARA_API NzMemoryManager
|
||||
{
|
||||
public:
|
||||
static void* Allocate(std::size_t size, bool multi, const char* file = nullptr, unsigned int line = 0);
|
||||
|
||||
static void Free(void* pointer, bool multi);
|
||||
|
||||
static unsigned int GetAllocatedBlockCount();
|
||||
static std::size_t GetAllocatedSize();
|
||||
static unsigned int GetAllocationCount();
|
||||
|
||||
static void NextFree(const char* file, unsigned int line);
|
||||
|
||||
private:
|
||||
NzMemoryManager();
|
||||
~NzMemoryManager();
|
||||
|
||||
static void Initialize();
|
||||
static void TimeInfo(char buffer[23]);
|
||||
static void Uninitialize();
|
||||
};
|
||||
|
||||
NAZARA_API void* operator new(std::size_t size, const char* file, unsigned int line);
|
||||
NAZARA_API void* operator new[](std::size_t size, const char* file, unsigned int line);
|
||||
NAZARA_API void operator delete(void* ptr, const char* file, unsigned int line) noexcept;
|
||||
NAZARA_API void operator delete[](void* ptr, const char* file, unsigned int line) noexcept;
|
||||
|
||||
#endif // NAZARA_DEBUG_MEMORYMANAGER_HPP
|
||||
|
||||
#ifndef NAZARA_DEBUG_MEMORYMANAGER_DISABLE_REDEFINITION
|
||||
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||
#define new new(__FILE__, __LINE__)
|
||||
#endif
|
||||
28
include/Nazara/Core/Debug/NewRedefinition.hpp
Normal file
28
include/Nazara/Core/Debug/NewRedefinition.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
// 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
|
||||
|
||||
// Pas de #pragma once car ce fichier est prévu pour être inclus plusieurs fois
|
||||
|
||||
#include <Nazara/Core/Config.hpp>
|
||||
#if NAZARA_CORE_MANAGE_MEMORY
|
||||
|
||||
#ifndef NAZARA_DEBUG_NEWREDEFINITION_HPP
|
||||
#define NAZARA_DEBUG_NEWREDEFINITION_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/MemoryManager.hpp>
|
||||
|
||||
NAZARA_API void* operator new(std::size_t size, const char* file, unsigned int line);
|
||||
NAZARA_API void* operator new[](std::size_t size, const char* file, unsigned int line);
|
||||
NAZARA_API void operator delete(void* ptr, const char* file, unsigned int line) noexcept;
|
||||
NAZARA_API void operator delete[](void* ptr, const char* file, unsigned int line) noexcept;
|
||||
|
||||
#endif // NAZARA_DEBUG_NEWREDEFINITION_HPP
|
||||
|
||||
#ifndef NAZARA_DEBUG_NEWREDEFINITION_DISABLE_REDEFINITION
|
||||
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||
#define new new(__FILE__, __LINE__)
|
||||
#endif
|
||||
|
||||
#endif // NAZARA_CORE_MANAGE_MEMORY
|
||||
Reference in New Issue
Block a user