]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR libstdc++/70966 make pmr::new_delete_resource() immortal
authorJonathan Wakely <jwakely@redhat.com>
Fri, 12 Oct 2018 13:04:24 +0000 (14:04 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 12 Oct 2018 13:04:24 +0000 (14:04 +0100)
commitb860a6a1fbcb21f581d8dcc5c0073a6015fad1a0
treedbf3dce980a38a1f326256c5ac83adfc9ef8c4f4
parent3505d09c54761cc6a8236547105132c34f3f9100
PR libstdc++/70966 make pmr::new_delete_resource() immortal

Construct the program-wide resource objects using placement new. This
means they have dynamic storage duration and won't be destroyed during
termination.

Backport from mainline
2018-07-24  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/70966
* include/experimental/memory_resource (__get_default_resource): Use
placement new to create an object with dynamic storage duration.

Backport from mainline
2018-06-20  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/70966
* include/experimental/memory_resource (__resource_adaptor_imp): Add
static assertions to enforce requirements on pointer types.
(__resource_adaptor_imp::get_allocator()): Add noexcept.
(new_delete_resource, null_memory_resource): Return address of an
object with dynamic storage duration.
(__null_memory_resource): Remove.
* testsuite/experimental/memory_resource/70966.cc: New.

From-SVN: r265097
libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/memory_resource
libstdc++-v3/testsuite/experimental/memory_resource/70966.cc [new file with mode: 0644]