Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 46b63ac2 authored by BRAMAS Berenger's avatar BRAMAS Berenger

Update memstat

parent f5946866
...@@ -21,7 +21,7 @@ FMemStats FMemStats::controler; ...@@ -21,7 +21,7 @@ FMemStats FMemStats::controler;
#ifdef ScalFMM_USE_MEM_STATS #ifdef ScalFMM_USE_MEM_STATS
// Regular scalar new // Regular scalar new
void* operator new(std::size_t n) throw(std::bad_alloc) void* operator new(std::size_t n)
{ {
using namespace std; using namespace std;
...@@ -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, std::nothrow_t const&) throw() void* operator new(size_t n,const std::nothrow_t& nothrow_value)
{ {
//if (n == 0) n = 1; //if (n == 0) n = 1;
void* const allocated = malloc(n + 8); void* const allocated = malloc(n + 8);
...@@ -57,19 +57,19 @@ FMemStats FMemStats::controler; ...@@ -57,19 +57,19 @@ FMemStats FMemStats::controler;
} }
// Regular array new // Regular array new
void* operator new[](size_t n) throw(std::bad_alloc) void* operator new[](size_t n)
{ {
return ::operator new(n); return ::operator new(n);
} }
// Nothrow array new // Nothrow array new
void* operator new[](size_t n, std::nothrow_t const&) throw() void* operator new[](size_t n,const std::nothrow_t& nothrow_value)
{ {
return ::operator new(n, std::nothrow); return ::operator new(n, std::nothrow);
} }
// Regular scalar delete // Regular scalar delete
void operator delete(void* p) throw(){ void operator delete(void* p) noexcept {
if(p){ if(p){
FMemStats::controler.deallocate( *(reinterpret_cast<size_t*>(static_cast<unsigned char*>(p) - 8)) ); FMemStats::controler.deallocate( *(reinterpret_cast<size_t*>(static_cast<unsigned char*>(p) - 8)) );
free(static_cast<unsigned char*>(p) - 8); free(static_cast<unsigned char*>(p) - 8);
...@@ -77,18 +77,18 @@ FMemStats FMemStats::controler; ...@@ -77,18 +77,18 @@ FMemStats FMemStats::controler;
} }
// Nothrow scalar delete // Nothrow scalar delete
void operator delete(void* p, std::nothrow_t const&) throw(){ void operator delete(void* p,const std::nothrow_t& nothrow_value) noexcept {
::operator delete(p); ::operator delete(p);
} }
// Regular array delete // Regular array delete
void operator delete[](void* p) throw() void operator delete[](void* p) noexcept
{ {
::operator delete(p); ::operator delete(p);
} }
// Nothrow array delete // Nothrow array delete
void operator delete[](void* p, std::nothrow_t const&) throw() void operator delete[](void* p,const std::nothrow_t& nothrow_value) noexcept
{ {
::operator delete(p); ::operator delete(p);
} }
......
...@@ -31,14 +31,14 @@ ...@@ -31,14 +31,14 @@
#include <new> #include <new>
#include <stdexcept> #include <stdexcept>
#warning You are using meme stats #warning You are using meme stats
void* operator new(std::size_t n) throw(std::bad_alloc); void* operator new(std::size_t n);
void* operator new(size_t n, std::nothrow_t const&) throw(); void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) ;
void* operator new[](size_t n) throw(std::bad_alloc); void* operator new[](std::size_t n);
void* operator new[](size_t n, std::nothrow_t const&) throw(); void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_value) ;
void operator delete(void* p) throw(); void operator delete(void* p) noexcept;
void operator delete(void* p, std::nothrow_t const&) throw(); void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) noexcept;
void operator delete[](void* p) throw(); void operator delete[](void* p) noexcept;
void operator delete[](void* p, std::nothrow_t const&) throw(); void operator delete[] (void* ptr, const std::nothrow_t& nothrow_constant) noexcept;
#endif #endif
/** Give the memory allocation details /** Give the memory allocation details
...@@ -68,14 +68,14 @@ private: ...@@ -68,14 +68,14 @@ private:
} }
#ifdef ScalFMM_USE_MEM_STATS #ifdef ScalFMM_USE_MEM_STATS
friend void* operator new(std::size_t n) throw(std::bad_alloc); friend void* operator new(std::size_t n);
friend void* operator new(size_t n, std::nothrow_t const&) throw(); friend void* operator new (std::size_t size, const std::nothrow_t& nothrow_value) ;
friend void* operator new[](size_t n) throw(std::bad_alloc); friend void* operator new[](std::size_t n);
friend void* operator new[](size_t n, std::nothrow_t const&) throw(); friend void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_value) ;
friend void operator delete(void* p) throw(); friend void operator delete(void* p) noexcept;
friend void operator delete(void* p, std::nothrow_t const&) throw(); friend void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) noexcept;
friend void operator delete[](void* p) throw(); friend void operator delete[](void* p) noexcept;
friend void operator delete[](void* p, std::nothrow_t const&) throw(); friend void operator delete[] (void* ptr, const std::nothrow_t& nothrow_constant) noexcept;
#endif #endif
public: public:
......
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