From ed8deed23c9d41b65d1ddc96a3b0a295ab5d9cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Wed, 1 Feb 2017 17:52:32 +0100 Subject: [PATCH 1/3] Core/MemoryHelper: Add PlacementDestroy --- include/Nazara/Core/MemoryHelper.hpp | 5 ++++- include/Nazara/Core/MemoryHelper.inl | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/Nazara/Core/MemoryHelper.hpp b/include/Nazara/Core/MemoryHelper.hpp index 6f53a012f..dc1bcc475 100644 --- a/include/Nazara/Core/MemoryHelper.hpp +++ b/include/Nazara/Core/MemoryHelper.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Jérôme Leclercq +// Copyright (C) 2017 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 @@ -38,6 +38,9 @@ namespace Nz template T* PlacementNew(T* ptr, Args&&... args); + template + void PlacementDestroy(T* ptr); + class StackAllocation { public: diff --git a/include/Nazara/Core/MemoryHelper.inl b/include/Nazara/Core/MemoryHelper.inl index f7380e1b8..dcee8ca4e 100644 --- a/include/Nazara/Core/MemoryHelper.inl +++ b/include/Nazara/Core/MemoryHelper.inl @@ -1,4 +1,4 @@ -// Copyright (C) 2017 Jérôme Leclercq +// Copyright (C) 2017 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 @@ -64,6 +64,17 @@ namespace Nz return new (ptr) T(std::forward(args)...); } + /*! + * \brief Calls the object destructor explicitly + * + * \param ptr Pointer to a previously constructed pointer on raw memory + */ + template + void PlacementDestroy(T* ptr) + { + ptr->~T(); + } + /*! * \ingroup core * \class Nz::StackAllocation From 9c66711a5362aa2c55a4012e761f890120ad5482 Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 1 Feb 2017 20:02:12 +0100 Subject: [PATCH 2/3] Update version --- include/Nazara/Prerequesites.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Nazara/Prerequesites.hpp b/include/Nazara/Prerequesites.hpp index 13a044f68..0ac6b0fae 100644 --- a/include/Nazara/Prerequesites.hpp +++ b/include/Nazara/Prerequesites.hpp @@ -77,8 +77,8 @@ // Nazara version macro #define NAZARA_VERSION_MAJOR 0 -#define NAZARA_VERSION_MINOR 2 -#define NAZARA_VERSION_PATCH 1 +#define NAZARA_VERSION_MINOR 3 +#define NAZARA_VERSION_PATCH 0 #include From 2518a3939ff54d84538ce93c0c8ee8ac0c1fa388 Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 1 Feb 2017 20:54:25 +0100 Subject: [PATCH 3/3] Update documentation version --- Doxyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 04a327a38..116ba2c2a 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "Nazara Engine" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.2 +PROJECT_NUMBER = 0.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a