1 // The -*- C++ -*- dynamic memory management header.
2 // Copyright (C) 1994, 96-97, 1998 Free Software Foundation
7 #pragma interface "new"
15 class bad_alloc : public exception {
17 virtual const char* what() const throw() { return "bad_alloc"; }
21 extern const nothrow_t nothrow;
22 typedef void (*new_handler)();
23 new_handler set_new_handler (new_handler);
27 // replaceable signatures
28 void *operator new (size_t) throw (std::bad_alloc);
29 void *operator new[] (size_t) throw (std::bad_alloc);
30 void operator delete (void *) throw();
31 void operator delete[] (void *) throw();
32 void *operator new (size_t, const std::nothrow_t&) throw();
33 void *operator new[] (size_t, const std::nothrow_t&) throw();
34 void operator delete (void *, const std::nothrow_t&) throw();
35 void operator delete[] (void *, const std::nothrow_t&) throw();
37 // default placement versions of operator new
38 inline void *operator new(size_t, void *place) throw() { return place; }
39 inline void *operator new[](size_t, void *place) throw() { return place; }