39#pragma GCC system_header
45#define __glibcxx_want_launder
46#define __glibcxx_want_hardware_interference_size
47#define __glibcxx_want_destroying_delete
48#define __glibcxx_want_constexpr_new
51#pragma GCC diagnostic push
52#pragma GCC diagnostic ignored "-Wc++11-extensions"
54#pragma GCC visibility push(default)
71#if __cplusplus >= 201103L
81 virtual const char*
what()
const throw();
84#if __cplusplus >= 201103L
85 class bad_array_new_length :
public bad_alloc
88 bad_array_new_length()
throw() { }
92 virtual ~bad_array_new_length()
throw();
95 virtual const char* what()
const throw();
100 enum class align_val_t:
size_t {};
105#if __cplusplus >= 201103L
106 explicit nothrow_t() =
default;
110 extern const nothrow_t nothrow;
120#if __cplusplus >= 201103L
137_GLIBCXX_NODISCARD
void*
operator new(std::size_t)
139 __attribute__((__externally_visible__, __malloc__));
140_GLIBCXX_NODISCARD
void*
operator new[](std::size_t)
142 __attribute__((__externally_visible__, __malloc__));
143void operator delete(
void*) _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
144 __attribute__((__externally_visible__));
145void operator delete[](
void*) _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
146 __attribute__((__externally_visible__));
147#if __cpp_sized_deallocation
148void operator delete(
void*, std::size_t)
149 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
150 __attribute__((__externally_visible__));
151void operator delete[](
void*, std::size_t)
152 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
153 __attribute__((__externally_visible__));
155_GLIBCXX_NODISCARD
void*
operator new(std::size_t,
const std::nothrow_t&)
156 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
157 __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
158_GLIBCXX_NODISCARD
void*
operator new[](std::size_t,
const std::nothrow_t&)
159 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
160 __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
161void operator delete(
void*,
const std::nothrow_t&)
162 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
163 __attribute__((__externally_visible__));
164void operator delete[](
void*,
const std::nothrow_t&)
165 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
166 __attribute__((__externally_visible__));
168_GLIBCXX_NODISCARD
void*
operator new(std::size_t, std::align_val_t)
170 __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__));
171_GLIBCXX_NODISCARD
void*
operator new(std::size_t, std::align_val_t,
const std::nothrow_t&)
172 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
173 __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__));
174void operator delete(
void*, std::align_val_t) _GLIBCXX_TXN_SAFE
175 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
176void operator delete(
void*, std::align_val_t,
const std::nothrow_t&)
178 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
179_GLIBCXX_NODISCARD
void*
operator new[](std::size_t, std::align_val_t)
181 __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__));
182_GLIBCXX_NODISCARD
void*
operator new[](std::size_t, std::align_val_t,
const std::nothrow_t&)
183 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
184 __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__));
185void operator delete[](
void*, std::align_val_t) _GLIBCXX_TXN_SAFE
186 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
187void operator delete[](
void*, std::align_val_t,
const std::nothrow_t&)
189 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
190#if __cpp_sized_deallocation
191void operator delete(
void*, std::size_t, std::align_val_t) _GLIBCXX_TXN_SAFE
192 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
193void operator delete[](
void*, std::size_t, std::align_val_t) _GLIBCXX_TXN_SAFE
194 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
198#if __cpp_lib_constexpr_new >= 202406L
199# define _GLIBCXX_PLACEMENT_CONSTEXPR constexpr
201# define _GLIBCXX_PLACEMENT_CONSTEXPR inline
205_GLIBCXX_NODISCARD _GLIBCXX_PLACEMENT_CONSTEXPR
206void*
operator new(std::size_t,
void* __p)
207 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
209_GLIBCXX_NODISCARD _GLIBCXX_PLACEMENT_CONSTEXPR
210void*
operator new[](std::size_t,
void* __p)
211 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
214#undef _GLIBCXX_PLACEMENT_CONSTEXPR
217inline void operator delete (
void*,
void*)
218 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
220inline void operator delete[](
void*,
void*)
221 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
228#ifdef __cpp_lib_launder
230 template<typename _Tp>
231 [[nodiscard]]
constexpr _Tp*
232 launder(_Tp* __p)
noexcept
234 if constexpr (__is_same(
const volatile _Tp,
const volatile void))
235 static_assert(!__is_same(
const volatile _Tp,
const volatile void),
236 "std::launder argument must not be a void pointer");
237#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
238 else if constexpr (__is_function(_Tp))
239 static_assert(!__is_function(_Tp),
240 "std::launder argument must not be a function pointer");
243 return __builtin_launder(__p);
248#ifdef __cpp_lib_hardware_interference_size
249 inline constexpr size_t hardware_destructive_interference_size = __GCC_DESTRUCTIVE_SIZE;
250 inline constexpr size_t hardware_constructive_interference_size = __GCC_CONSTRUCTIVE_SIZE;
254#if __cplusplus >= 202002L
266#pragma GCC visibility pop
267#pragma GCC diagnostic pop
ISO C++ entities toplevel namespace is std.
new_handler set_new_handler(new_handler)
Takes a replacement handler as the argument, returns the previous handler.
new_handler get_new_handler() noexcept
Return the current new handler.
constexpr destroying_delete_t destroying_delete
Tag variable of type destroying_delete_t.
Exception possibly thrown by new.
virtual const char * what() const
Tag type used to declare a class-specific operator delete that can invoke the destructor before deall...
Base class for all library exceptions.