r263536 - in /trunk/libstdc++-v3: ChangeLog src...

redi@gcc.gnu.org redi@gcc.gnu.org
Tue Aug 14 13:13:00 GMT 2018


Author: redi
Date: Tue Aug 14 13:13:37 2018
New Revision: 263536

URL: https://gcc.gnu.org/viewcvs?rev=263536&root=gcc&view=rev
Log:
PR libstdc++/86846 Alternative to pointer-width atomics

Define a class using std::mutex for when std::atomic<memory_resource*>
cannot be used to implement the default memory resource.

When std::mutex constructor is not constexpr the constant_init trick
won't work, so just define a global and use init_priority for it. The
compiler warns about using reserved priority, so put the definition in a
header file using #pragma GCC system_header to suppress the warning.

	PR libstdc++/86846
	* src/c++17/default_resource.h: New file, defining default_res.
	* src/c++17/memory_resource.cc [ATOMIC_POINTER_LOCK_FREE != 2]
	(atomic_mem_res): Define alternative for atomic<memory_resource*>
	using a mutex instead of atomics.

Added:
    trunk/libstdc++-v3/src/c++17/default_resource.h
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/src/c++17/memory_resource.cc



More information about the Libstdc++-cvs mailing list