Whole document tree newGo to the documentation of this file.00001 // The -*- C++ -*- dynamic memory management header. 00002 00003 // Copyright (C) 1994, 1996, 1997, 1998, 2000, 2001 Free Software Foundation 00004 00005 // This file is part of GNU CC. 00006 // 00007 // GNU CC is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation; either version 2, or (at your option) 00010 // any later version. 00011 // 00012 // GNU CC is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with GNU CC; see the file COPYING. If not, write to 00019 // the Free Software Foundation, 59 Temple Place - Suite 330, 00020 // Boston, MA 02111-1307, USA. 00021 00022 // As a special exception, you may use this file as part of a free software 00023 // library without restriction. Specifically, if other files instantiate 00024 // templates or use macros or inline functions from this file, or you compile 00025 // this file and link it with other files to produce an executable, this 00026 // file does not by itself cause the resulting executable to be covered by 00027 // the GNU General Public License. This exception does not however 00028 // invalidate any other reasons why the executable file might be covered by 00029 // the GNU General Public License. 00030 00037 #ifndef __NEW__ 00038 #define __NEW__ 00039 00040 #include <cstddef> 00041 #include <exception> 00042 00043 extern "C++" { 00044 00045 namespace std 00046 { 00049 class bad_alloc : public exception 00050 { 00051 public: 00052 bad_alloc() throw() { } 00053 virtual ~bad_alloc() throw(); 00054 }; 00055 00056 struct nothrow_t { }; 00057 extern const nothrow_t nothrow; 00060 typedef void (*new_handler)(); 00062 new_handler set_new_handler(new_handler); 00063 } // namespace std 00064 00066 00076 void *operator new(std::size_t) throw (std::bad_alloc); 00077 void *operator new[](std::size_t) throw (std::bad_alloc); 00078 void operator delete(void *) throw(); 00079 void operator delete[](void *) throw(); 00080 void *operator new(std::size_t, const std::nothrow_t&) throw(); 00081 void *operator new[](std::size_t, const std::nothrow_t&) throw(); 00082 void operator delete(void *, const std::nothrow_t&) throw(); 00083 void operator delete[](void *, const std::nothrow_t&) throw(); 00084 00085 // Default placement versions of operator new. 00086 inline void *operator new(std::size_t, void *place) throw() { return place; } 00087 inline void *operator new[](std::size_t, void *place) throw() { return place; } 00089 } // extern "C++" 00090 00091 #endif Generated on Mon Apr 8 03:11:30 2002 for libstdc++-v3 Source by ![]() |