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

Update memstat

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