1 // The -*- C++ -*- dynamic memory management header.
2 // Copyright (C) 1994, 1996 Free Software Foundation
7 #pragma interface "new"
17 class bad_alloc : public exception {
19 virtual const char* what() const throw() { return "bad_alloc"; }
23 extern const nothrow_t nothrow;
24 typedef void (*new_handler)();
25 extern "C" new_handler set_new_handler (new_handler);
31 // G++ implementation internals
32 extern new_handler __new_handler;
33 extern "C" void __default_new_handler (void);
35 // replaceable signatures
36 void *operator new (size_t);
37 void *operator new (size_t, const nothrow_t&) throw();
38 void *operator new[] (size_t);
39 void *operator new[] (size_t, const nothrow_t&) throw();
40 void operator delete (void *) throw();
41 void operator delete[] (void *) throw();
43 // default placement versions of operator new
44 inline void *operator new(size_t, void *place) throw() { return place; }
45 inline void *operator new[](size_t, void *place) throw() { return place; }