1
/* Copyright (C) 2004 Garrett A. Kajmowicz
3
This file is part of the uClibc++ Library.
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Lesser General Public License for more details.
15
You should have received a copy of the GNU Lesser General Public
16
License along with this library; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#include <basic_definitions>
24
#ifndef __STD_NEW_OPERATOR
25
#define __STD_NEW_OPERATOR 1
27
#pragma GCC visibility push(default)
30
class _UCXXEXPORT bad_alloc : public exception {};
32
struct _UCXXEXPORT nothrow_t {};
33
extern const nothrow_t nothrow;
35
typedef void (*new_handler)();
36
_UCXXEXPORT new_handler set_new_handler(new_handler new_p) throw();
40
_UCXXEXPORT void* operator new(std::size_t numBytes) throw(std::bad_alloc);
41
_UCXXEXPORT void operator delete(void* ptr) throw();
43
_UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc);
44
_UCXXEXPORT void operator delete[](void * ptr) throw();
47
_UCXXEXPORT void* operator new(std::size_t numBytes, const std::nothrow_t& ) throw();
48
_UCXXEXPORT void operator delete(void* ptr, const std::nothrow_t& ) throw();
50
_UCXXEXPORT void* operator new[](std::size_t numBytes, const std::nothrow_t& ) throw();
51
_UCXXEXPORT void operator delete[](void* ptr, const std::nothrow_t& ) throw();
54
/* Placement operators */
55
inline void* operator new(std::size_t, void* ptr) throw() {return ptr; }
56
inline void operator delete(void* , void *) throw() { }
58
inline void* operator new[](std::size_t, void *p) throw() { return p; }
59
inline void operator delete[](void* , void *) throw() {}
61
#pragma GCC visibility pop