Home | History | Annotate | Download | only in include
      1 /* -*- c++ -*- */
      2 #ifndef __NEW__
      3 #define __NEW__
      4 
      5 #include <stddef.h>
      6 
      7 extern "C++" {
      8 
      9 namespace std {
     10   using ::size_t;
     11   struct nothrow_t {};
     12   extern const nothrow_t nothrow;
     13 }
     14 
     15 void* operator new(std::size_t);
     16 void* operator new(std::size_t, const std::nothrow_t&);
     17 void operator delete(void*) throw();
     18 // TODO: void operator delete(void*, std::size_t) throw();
     19 void operator delete(void*, const std::nothrow_t&) throw();
     20 
     21 void* operator new[](std::size_t);
     22 void* operator new[](std::size_t, const std::nothrow_t&);
     23 void operator delete[](void*) throw();
     24 // TODO: void operator delete[](void*, std::size_t) throw();
     25 void operator delete[](void*, const std::nothrow_t&) throw();
     26 
     27 // These four are not replaceable, so should be inlined.
     28 inline void* operator new(std::size_t, void* p) { return p; }
     29 inline void* operator new[](std::size_t, void* p) { return p; }
     30 inline void operator delete(void*, void*) throw() { }
     31 inline void operator delete[](void*, void*) throw() { }
     32 
     33 }  // extern C++
     34 
     35 #endif // __NEW__
     36