Lines Matching full:new
14 #include <new>
26 // Implement all new and delete operators as weak definitions
46 _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE _LIBCPP_WEAK void* operator new(std::size_t size) _THROW_BAD_ALLOC {
53 _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {
57 !std::__is_function_overridden(static_cast<void* (*)(std::size_t)>(&operator new)),
58 "libc++ was configured with exceptions disabled and `operator new(size_t)` has been overridden, "
59 "but `operator new(size_t, nothrow_t)` has not been overridden. This is problematic because "
60 "`operator new(size_t, nothrow_t)` must call `operator new(size_t)`, which will terminate in case "
61 "it fails to allocate, making it impossible for `operator new(size_t, nothrow_t)` to fulfill its "
63 "`operator new(size_t, nothrow_t)` as well.");
70 p = ::operator new(size);
77 _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE _LIBCPP_WEAK void* operator new[](size_t size) _THROW_BAD_ALLOC {
78 return ::operator new(size);
81 _LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {
85 !std::__is_function_overridden(static_cast<void* (*)(std::size_t)>(&operator new[])),
86 "libc++ was configured with exceptions disabled and `operator new[](size_t)` has been overridden, "
87 "but `operator new[](size_t, nothrow_t)` has not been overridden. This is problematic because "
88 "`operator new[](size_t, nothrow_t)` must call `operator new[](size_t)`, which will terminate in case "
89 "it fails to allocate, making it impossible for `operator new[](size_t, nothrow_t)` to fulfill its "
91 "`operator new[](size_t, nothrow_t)` as well.");
98 p = ::operator new[](size);
140 operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
147 _LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
151 !std::__is_function_overridden(static_cast<void* (*)(std::size_t, std::align_val_t)>(&operator new)),
152 "libc++ was configured with exceptions disabled and `operator new(size_t, align_val_t)` has been overridden, "
153 "but `operator new(size_t, align_val_t, nothrow_t)` has not been overridden. This is problematic because "
154 "`operator new(size_t, align_val_t, nothrow_t)` must call `operator new(size_t, align_val_t)`, which will "
155 "terminate in case it fails to allocate, making it impossible for `operator new(size_t, align_val_t, nothrow_t)` "
157 "`operator new(size_t, align_val_t, nothrow_t)` as well.");
164 p = ::operator new(size, alignment);
172 operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
173 return ::operator new(size, alignment);
176 _LIBCPP_WEAK void* operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
180 !std::__is_function_overridden(static_cast<void* (*)(std::size_t, std::align_val_t)>(&operator new[])),
181 "libc++ was configured with exceptions disabled and `operator new[](size_t, align_val_t)` has been overridden, "
182 "but `operator new[](size_t, align_val_t, nothrow_t)` has not been overridden. This is problematic because "
183 "`operator new[](size_t, align_val_t, nothrow_t)` must call `operator new[](size_t, align_val_t)`, which will "
184 "terminate in case it fails to allocate, making it impossible for `operator new[](size_t, align_val_t, "
187 "`operator new[](size_t, align_val_t, nothrow_t)` as well.");
194 p = ::operator new[](size, alignment);