Loading include/cxx/new +11 −0 Changes for include/cxx/new: 11 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -70,6 +70,17 @@ namespace std __attribute__((__visibility__("default"))) { struct nothrow_t; } void* operator new(unsigned long size, std::align_val_t align, const std::nothrow_t&) noexcept; void* operator new[](unsigned long size, std::align_val_t align, const std::nothrow_t&) noexcept; /* Real gap: the plain nothrow forms were missing (libaom's * av1/ratectrl_rtc.cc does `new (std::nothrow) AV1RateControlRTC(...)`), * plus the nothrow deletes a nothrow new-expression calls when the * constructor throws. */ void* operator new(unsigned long size, const std::nothrow_t&) noexcept; void* operator new[](unsigned long size, const std::nothrow_t&) noexcept; void operator delete(void* ptr, const std::nothrow_t&) noexcept; void operator delete[](void* ptr, const std::nothrow_t&) noexcept; void operator delete(void* ptr, std::align_val_t align, const std::nothrow_t&) noexcept; void operator delete[](void* ptr, std::align_val_t align, const std::nothrow_t&) noexcept; /* The sized+aligned combination -- clang recognizes these as builtin * "usual deallocation function" candidates and will emit a call to the * mangled symbol even without a visible declaration (confirmed via a Loading src/linux/alloc.cpp +36 −0 Changes for src/linux/alloc.cpp: 36 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -383,6 +383,26 @@ void *operator new[](unsigned long size){ return operator new(size); } /* nothrow: the same new_handler loop as above, but no handler -- or one * that throws bad_alloc -- means a null return instead of a throw. */ void* operator new(unsigned long size, const std::nothrow_t&) noexcept { void* p; while (!(p = sys::__internal::allocator::getInstance().alloc(size))) { std::new_handler h = std::get_new_handler(); if (!h) return nullptr; try { h(); } catch (...) { return nullptr; } } return p; } void* operator new[](unsigned long size, const std::nothrow_t& nt) noexcept { return operator new(size, nt); } /* Real gap: throw() is a real dynamic exception specification -- * deprecated since C++11, and removed from the language entirely in * C++20 (this project targets C++23) -- Clang still accepts it as a Loading Loading @@ -502,3 +522,19 @@ void* operator new(unsigned long size, std::align_val_t align, const std::nothro void* operator new[](unsigned long size, std::align_val_t align, const std::nothrow_t&) noexcept { return try_aligned_alloc(size, align); } void operator delete(void* ptr, const std::nothrow_t&) noexcept { operator delete(ptr); } void operator delete[](void* ptr, const std::nothrow_t&) noexcept { operator delete[](ptr); } void operator delete(void* ptr, std::align_val_t align, const std::nothrow_t&) noexcept { operator delete(ptr, align); } void operator delete[](void* ptr, std::align_val_t align, const std::nothrow_t&) noexcept { operator delete[](ptr, align); } Loading
include/cxx/new +11 −0 Changes for include/cxx/new: 11 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -70,6 +70,17 @@ namespace std __attribute__((__visibility__("default"))) { struct nothrow_t; } void* operator new(unsigned long size, std::align_val_t align, const std::nothrow_t&) noexcept; void* operator new[](unsigned long size, std::align_val_t align, const std::nothrow_t&) noexcept; /* Real gap: the plain nothrow forms were missing (libaom's * av1/ratectrl_rtc.cc does `new (std::nothrow) AV1RateControlRTC(...)`), * plus the nothrow deletes a nothrow new-expression calls when the * constructor throws. */ void* operator new(unsigned long size, const std::nothrow_t&) noexcept; void* operator new[](unsigned long size, const std::nothrow_t&) noexcept; void operator delete(void* ptr, const std::nothrow_t&) noexcept; void operator delete[](void* ptr, const std::nothrow_t&) noexcept; void operator delete(void* ptr, std::align_val_t align, const std::nothrow_t&) noexcept; void operator delete[](void* ptr, std::align_val_t align, const std::nothrow_t&) noexcept; /* The sized+aligned combination -- clang recognizes these as builtin * "usual deallocation function" candidates and will emit a call to the * mangled symbol even without a visible declaration (confirmed via a Loading
src/linux/alloc.cpp +36 −0 Changes for src/linux/alloc.cpp: 36 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -383,6 +383,26 @@ void *operator new[](unsigned long size){ return operator new(size); } /* nothrow: the same new_handler loop as above, but no handler -- or one * that throws bad_alloc -- means a null return instead of a throw. */ void* operator new(unsigned long size, const std::nothrow_t&) noexcept { void* p; while (!(p = sys::__internal::allocator::getInstance().alloc(size))) { std::new_handler h = std::get_new_handler(); if (!h) return nullptr; try { h(); } catch (...) { return nullptr; } } return p; } void* operator new[](unsigned long size, const std::nothrow_t& nt) noexcept { return operator new(size, nt); } /* Real gap: throw() is a real dynamic exception specification -- * deprecated since C++11, and removed from the language entirely in * C++20 (this project targets C++23) -- Clang still accepts it as a Loading Loading @@ -502,3 +522,19 @@ void* operator new(unsigned long size, std::align_val_t align, const std::nothro void* operator new[](unsigned long size, std::align_val_t align, const std::nothrow_t&) noexcept { return try_aligned_alloc(size, align); } void operator delete(void* ptr, const std::nothrow_t&) noexcept { operator delete(ptr); } void operator delete[](void* ptr, const std::nothrow_t&) noexcept { operator delete[](ptr); } void operator delete(void* ptr, std::align_val_t align, const std::nothrow_t&) noexcept { operator delete(ptr, align); } void operator delete[](void* ptr, std::align_val_t align, const std::nothrow_t&) noexcept { operator delete[](ptr, align); }