Fixed missing Leaks.cpp in 2D/3D modules
Former-commit-id: 2e059122d2ef7500638037ecec45af8fd66c5f3a
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -10,7 +10,6 @@
|
||||
*.project
|
||||
|
||||
# Nazara build
|
||||
|
||||
examples/bin/*.exe
|
||||
lib/libNazara*.a
|
||||
lib/Nazara*.dll
|
||||
@@ -48,10 +47,6 @@ $RECYCLE.BIN/
|
||||
*.user
|
||||
*.sln.docstates
|
||||
|
||||
# Build results
|
||||
[Dd]ebug*/
|
||||
[Rr]elease/
|
||||
|
||||
[Tt]est[Rr]esult
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
|
||||
29
src/Nazara/2D/Debug/Leaks.cpp
Normal file
29
src/Nazara/2D/Debug/Leaks.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2012 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - 2D Module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/2D/Config.hpp>
|
||||
#if NAZARA_2D_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||
#include <new>
|
||||
|
||||
void* operator new(std::size_t size)
|
||||
{
|
||||
return NzMemoryManager::Allocate(size, false);
|
||||
}
|
||||
|
||||
void* operator new[](std::size_t size)
|
||||
{
|
||||
return NzMemoryManager::Allocate(size, true);
|
||||
}
|
||||
|
||||
void operator delete(void* pointer) noexcept
|
||||
{
|
||||
NzMemoryManager::Free(pointer, false);
|
||||
}
|
||||
|
||||
void operator delete[](void* pointer) noexcept
|
||||
{
|
||||
NzMemoryManager::Free(pointer, true);
|
||||
}
|
||||
#endif
|
||||
29
src/Nazara/3D/Debug/Leaks.cpp
Normal file
29
src/Nazara/3D/Debug/Leaks.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2012 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - 3D Module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/3D/Config.hpp>
|
||||
#if NAZARA_3D_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||
#include <new>
|
||||
|
||||
void* operator new(std::size_t size)
|
||||
{
|
||||
return NzMemoryManager::Allocate(size, false);
|
||||
}
|
||||
|
||||
void* operator new[](std::size_t size)
|
||||
{
|
||||
return NzMemoryManager::Allocate(size, true);
|
||||
}
|
||||
|
||||
void operator delete(void* pointer) noexcept
|
||||
{
|
||||
NzMemoryManager::Free(pointer, false);
|
||||
}
|
||||
|
||||
void operator delete[](void* pointer) noexcept
|
||||
{
|
||||
NzMemoryManager::Free(pointer, true);
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user