gcc/libstdc++-v3
Jonathan Wakely 52ea1caf28 PR libstdc++/77691 fix resource_adaptor failures due to max_align_t bugs
Remove the hardcoded whitelist of allocators expected to return memory
aligned to alignof(max_align_t), because that doesn't work when the
platform's malloc() and GCC's max_align_t do not agree what the largest
fundamental alignment is. It's also sub-optimal for user-defined
allocators that return memory suitable for any fundamental alignment.

Instead use a hardcoded list of alignments that are definitely supported
by the platform malloc, and use a copy of the allocator rebound to a POD
type with the requested alignment. Only allocate an oversized
buffer to use with std::align for alignments larger than any of the
hardcoded values.

For 32-bit Solaris x86 do not include alignof(max_align_t) in the
hardcoded values.

	PR libstdc++/77691
	* include/experimental/memory_resource: Add system header pragma.
	(__resource_adaptor_common::__guaranteed_alignment): Remove.
	(__resource_adaptor_common::_Types)
	(__resource_adaptor_common::__new_list)
	(__resource_adaptor_common::_New_list)
	(__resource_adaptor_common::_Alignments)
	(__resource_adaptor_common::_Fund_align_types): New utilities for
	creating a list of types with fundamental alignments.
	(__resource_adaptor_imp::do_allocate): Call new _M_allocate function.
	(__resource_adaptor_imp::do_deallocate): Call new _M_deallocate
	function.
	(__resource_adaptor_imp::_M_allocate): New function that first tries
	to use an allocator rebound to a type with a fundamental alignment.
	(__resource_adaptor_imp::_M_deallocate): Likewise for deallocation.
	* testsuite/experimental/memory_resource/new_delete_resource.cc:
	Adjust expected allocation sizes.
	* testsuite/experimental/memory_resource/resource_adaptor.cc: Remove
	xfail.

From-SVN: r271522
2019-05-22 21:29:39 +01:00
..
config Remove obsolete Solaris 10 support 2019-05-14 17:17:23 +00:00
doc Fix names of _Lock_policy constants in libstdc++ manual 2019-05-21 14:50:35 +01:00
include PR libstdc++/77691 fix resource_adaptor failures due to max_align_t bugs 2019-05-22 21:29:39 +01:00
libsupc++ Remove obsolete Solaris 10 support 2019-05-14 17:17:23 +00:00
po
python PR libstdc++/90520 adjust Xmethod for recent unique_ptr changes 2019-05-18 00:08:00 +01:00
scripts
src Remove incorrect assertion from filesystem::absolute 2019-05-16 23:52:10 +01:00
testsuite PR libstdc++/77691 fix resource_adaptor failures due to max_align_t bugs 2019-05-22 21:29:39 +01:00
acinclude.m4
aclocal.m4
ChangeLog PR libstdc++/77691 fix resource_adaptor failures due to max_align_t bugs 2019-05-22 21:29:39 +01:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
config.h.in
configure
configure.ac
configure.host Remove obsolete Solaris 10 support 2019-05-14 17:17:23 +00:00
crossconfig.m4
fragment.am
linkage.m4
Makefile.am
Makefile.in
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.