================
@@ -38,39 +44,53 @@ static void* operator_new_impl(std::size_t size) noexcept {
_LIBCPP_WEAK void* operator new(std::size_t size) _THROW_BAD_ALLOC {
void* p = operator_new_impl(size);
-# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
if (p == nullptr)
- throw std::bad_alloc();
-# endif
+ __throw_bad_alloc_shim();
return p;
}
_LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {
+# ifdef _LIBCPP_HAS_NO_EXCEPTIONS
+ _LIBCPP_ASSERT_SHIM(
----------------
EricWF wrote:
I think you're forgetting how hot of a path this is. I don't think we want to
be doing anything more than we need in the majority of cases.
https://github.com/llvm/llvm-project/pull/69498
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits