Commit e9b5656e authored by Samuel Pitoiset's avatar Samuel Pitoiset Committed by BRAMAS Berenger

Src/Utils: fix compilation warnings detected by Clang for mem stats

'noexcept' must be specified for both destructors and constructors.
This fixes compilation warnings when -DScalFMM_USE_MEM_STATS is enabled.
parent 8a34c9f3
...@@ -44,7 +44,7 @@ FMemStats FMemStats::controler; ...@@ -44,7 +44,7 @@ FMemStats FMemStats::controler;
} }
// Nothrow scalar new // Nothrow scalar new
void* operator new(size_t n,const std::nothrow_t& nothrow_value) void* operator new(size_t n,const std::nothrow_t& nothrow_value) noexcept
{ {
//if (n == 0) n = 1; //if (n == 0) n = 1;
void* const allocated = malloc(n + 8); void* const allocated = malloc(n + 8);
...@@ -63,7 +63,7 @@ FMemStats FMemStats::controler; ...@@ -63,7 +63,7 @@ FMemStats FMemStats::controler;
} }
// Nothrow array new // Nothrow array new
void* operator new[](size_t n,const std::nothrow_t& nothrow_value) void* operator new[](size_t n,const std::nothrow_t& nothrow_value) noexcept
{ {
return ::operator new(n, std::nothrow); return ::operator new(n, std::nothrow);
} }
......
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
#include <stdexcept> #include <stdexcept>
#warning You are using meme stats #warning You are using meme stats
void* operator new(std::size_t n); void* operator new(std::size_t n);
void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) ; void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) noexcept;
void* operator new[](std::size_t n); void* operator new[](std::size_t n);
void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_value) ; void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_value) noexcept;
void operator delete(void* p) noexcept; void operator delete(void* p) noexcept;
void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) noexcept; void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) noexcept;
void operator delete[](void* p) noexcept; void operator delete[](void* p) noexcept;
...@@ -69,9 +69,9 @@ private: ...@@ -69,9 +69,9 @@ private:
#ifdef ScalFMM_USE_MEM_STATS #ifdef ScalFMM_USE_MEM_STATS
friend void* operator new(std::size_t n); friend void* operator new(std::size_t n);
friend void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) ; friend void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) noexcept;
friend void* operator new[](std::size_t n); friend void* operator new[](std::size_t n);
friend void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_value) ; friend void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_value) noexcept;
friend void operator delete(void* p) noexcept; friend void operator delete(void* p) noexcept;
friend void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) noexcept; friend void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) noexcept;
friend void operator delete[](void* p) noexcept; friend void operator delete[](void* p) noexcept;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment