PR libstdc++/77691 increase allocation size to at least alignment
commitb051fcf18eb15789a92498e1f85656af9ab3e822
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Oct 2018 23:21:11 +0000 (11 23:21 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Oct 2018 23:21:11 +0000 (11 23:21 +0000)
tree3edecd41269f5ea8a5db5ab7adca024655100032
parent3770d6de4269327d14c86f924fdeb6fcb500a1b8
PR libstdc++/77691 increase allocation size to at least alignment

It's not safe to assume that malloc(n) returns memory aligned to more
than n, so when relying on the guaranteed alignment of malloc ensure
that the number of bytes allocated is at least as large as the
alignment.

PR libstdc++/77691
* include/experimental/memory_resource (__resource_adaptor_imp): Do
not allocate sizes smaller than alignment when relying on guaranteed
alignment.
* testsuite/experimental/memory_resource/new_delete_resource.cc:
Adjust expected number of bytes allocated for alignof(max_align_t).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@265068 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/memory_resource
libstdc++-v3/testsuite/experimental/memory_resource/new_delete_resource.cc