blob: 0f25a5c2b8527800608151aa1da80eb468558fa5 [file] [log] [blame]
// 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++" {
#ifdef __HONOR_STD
namespace std {
class bad_alloc : public exception {
virtual const char* what() const throw() { return "bad_alloc"; }
struct nothrow_t {};
extern const nothrow_t nothrow;
typedef void (*new_handler)();
new_handler set_new_handler (new_handler);
#ifdef __HONOR_STD
} // namespace std
// replaceable signatures
void *operator new (size_t) throw (std::bad_alloc);
void *operator new[] (size_t) throw (std::bad_alloc);
void operator delete (void *) throw();
void operator delete[] (void *) throw();
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();
// 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++"