1998-03-29 12:14:27 +04:00
|
|
|
// The -*- C++ -*- dynamic memory management header.
|
|
|
|
// Copyright (C) 1994, 1996 Free Software Foundation
|
|
|
|
|
|
|
|
#ifndef __NEW__
|
|
|
|
#define __NEW__
|
|
|
|
|
|
|
|
#pragma interface "new"
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <exception>
|
|
|
|
|
|
|
|
extern "C++" {
|
|
|
|
|
1998-08-16 21:35:45 +04:00
|
|
|
#ifdef __HONOR_STD
|
1998-03-29 12:14:27 +04:00
|
|
|
namespace std {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class bad_alloc : public exception {
|
|
|
|
public:
|
|
|
|
virtual const char* what() const throw() { return "bad_alloc"; }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nothrow_t {};
|
|
|
|
extern const nothrow_t nothrow;
|
|
|
|
typedef void (*new_handler)();
|
1998-08-16 21:35:45 +04:00
|
|
|
new_handler set_new_handler (new_handler);
|
1998-03-29 12:14:27 +04:00
|
|
|
|
1998-08-16 21:35:45 +04:00
|
|
|
#ifdef __HONOR_STD
|
1998-03-29 12:14:27 +04:00
|
|
|
} // namespace std
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// replaceable signatures
|
1998-08-16 21:35:45 +04:00
|
|
|
void *operator new (size_t) throw (std::bad_alloc);
|
|
|
|
void *operator new[] (size_t) throw (std::bad_alloc);
|
1998-03-29 12:14:27 +04:00
|
|
|
void operator delete (void *) throw();
|
|
|
|
void operator delete[] (void *) throw();
|
1998-08-16 21:35:45 +04:00
|
|
|
void *operator new (size_t, const std::nothrow_t&) throw();
|
|
|
|
void *operator new[] (size_t, const std::nothrow_t&) throw();
|
|
|
|
void operator delete (void *, const std::nothrow_t&) throw();
|
|
|
|
void operator delete[] (void *, const std::nothrow_t&) throw();
|
1998-03-29 12:14:27 +04:00
|
|
|
|
|
|
|
// default placement versions of operator new
|
|
|
|
inline void *operator new(size_t, void *place) throw() { return place; }
|
|
|
|
inline void *operator new[](size_t, void *place) throw() { return place; }
|
|
|
|
} // extern "C++"
|
|
|
|
|
|
|
|
#endif
|