libstdc++: Use nothrow new in std::stacktrace
authorJonathan Wakely <jwakely@redhat.com>
Tue, 12 Apr 2022 09:35:43 +0000 (10:35 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 12 Apr 2022 21:38:31 +0000 (22:38 +0100)
commite48933f00d676658ad065d9691a1b61446745386
tree960dd4e9efe489dad33e8abf25b4af328ee97b54
parent2ce0f5185ba95131b3c538507323d8ecb561a0c2
libstdc++: Use nothrow new in std::stacktrace

We can avoid the overhead of handling a bad_alloc exception from
std::allocator<std::stacktrace_entry>::allocate by just calling the
nothrow operator new instead.

libstdc++-v3/ChangeLog:

* include/std/stacktrace (basic_stacktrace::_Impl::_M_allocate):
Use nothrow new instead of try block for std::allocator.
(basic_stacktrace::_Impl::_M_deallocate): Use delete for
std::allocator.
libstdc++-v3/include/std/stacktrace