2011-05-16 13:00:45 +00:00
|
|
|
// Standard C++ dynamic memory management header
|
|
|
|
|
|
|
|
#ifndef _NEW
|
|
|
|
#define _NEW
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
|
#include <exception>
|
|
|
|
|
|
|
|
extern "C++" {
|
|
|
|
|
2013-01-26 18:34:33 +00:00
|
|
|
class bad_alloc : public exception
|
2011-05-16 13:00:45 +00:00
|
|
|
{
|
2013-01-26 18:34:33 +00:00
|
|
|
public:
|
|
|
|
bad_alloc(const char *name = "bad alloc") throw()
|
|
|
|
: exception(name) { }
|
2011-05-16 13:00:45 +00:00
|
|
|
|
2013-01-26 18:34:33 +00:00
|
|
|
virtual ~bad_alloc() throw() { }
|
|
|
|
};
|
2011-05-16 13:00:45 +00:00
|
|
|
|
2013-01-26 18:34:33 +00:00
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
using ::bad_alloc;
|
2011-05-16 13:00:45 +00:00
|
|
|
|
2013-01-26 18:34:33 +00:00
|
|
|
struct nothrow_t { };
|
2011-05-16 13:00:45 +00:00
|
|
|
|
2013-01-26 18:34:33 +00:00
|
|
|
extern const nothrow_t nothrow;
|
2011-05-16 13:00:45 +00:00
|
|
|
} // namespace std
|
|
|
|
|
|
|
|
typedef void (*new_handler)();
|
|
|
|
|
|
|
|
new_handler set_new_handler(new_handler) throw();
|
|
|
|
|
|
|
|
void* operator new (std::size_t size, const std::nothrow_t& nothrow_constant) throw();
|
|
|
|
inline void* operator new (std::size_t size, void* ptr) throw() { return ptr; }
|
|
|
|
void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_constant) throw();
|
|
|
|
inline void* operator new[] (std::size_t size, void* ptr) throw() { return ptr; }
|
|
|
|
|
|
|
|
void operator delete (void* ptr) throw ();
|
|
|
|
void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) throw();
|
|
|
|
inline void operator delete (void* ptr, void* voidptr2) throw() { }
|
|
|
|
void operator delete[] (void* ptr) throw ();
|
|
|
|
void operator delete[] (void* ptr, const std::nothrow_t& nothrow_constant) throw();
|
|
|
|
inline void operator delete[] (void* ptr, void* voidptr2) throw() { }
|
2013-01-26 18:34:33 +00:00
|
|
|
|
2011-05-16 13:00:45 +00:00
|
|
|
} // extern "C++"
|
|
|
|
|
|
|
|
#endif
|