r262953 - in /trunk/libstdc++-v3: ChangeLog con...

redi@gcc.gnu.org redi@gcc.gnu.org
Tue Jul 24 21:09:00 GMT 2018


Author: redi
Date: Tue Jul 24 21:09:55 2018
New Revision: 262953

URL: https://gcc.gnu.org/viewcvs?rev=262953&root=gcc&view=rev
Log:
Add initial version of C++17 <memory_resource> header

This is missing the synchronized_pool_resource and
unsynchronized_pool_resource classes but is otherwise complete.

This is a new implementation, not based on the existing code in
<experimental/memory_resource>, but memory_resource and
polymorphic_allocator ended up looking almost the same anyway.

The constant_init kluge in src/c++17/memory_resource.cc is apparently
due to Richard Smith and ensures that the objects are constructed during
constant initialiation phase and not destroyed (because the
constant_init destructor doesn't destroy the union member and the
storage is not reused).

	* config/abi/pre/gnu.ver: Export new symbols.
	* configure: Regenerate.
	* include/Makefile.am: Add new <memory_resource> header.
	* include/Makefile.in: Regenerate.
	* include/precompiled/stdc++.h: Include <memory_resource> for C++17.
	* include/std/memory_resource: New header.
	(memory_resource, polymorphic_allocator, new_delete_resource)
	(null_memory_resource, set_default_resource, get_default_resource)
	(pool_options, monotonic_buffer_resource): Define.
	* src/Makefile.am: Add c++17 directory.
	* src/Makefile.in: Regenerate.
	* src/c++11/Makefile.am: Fix comment.
	* src/c++17/Makefile.am: Add makefile for new sub-directory.
	* src/c++17/Makefile.in: Generate.
	* src/c++17/memory_resource.cc: New.
	(newdel_res_t, null_res_t, constant_init, newdel_res, null_res)
	(default_res, new_delete_resource, null_memory_resource)
	(set_default_resource, get_default_resource): Define.
	* testsuite/20_util/memory_resource/1.cc: New test.
	* testsuite/20_util/memory_resource/2.cc: New test.
	* testsuite/20_util/monotonic_buffer_resource/1.cc: New test.
	* testsuite/20_util/monotonic_buffer_resource/allocate.cc: New test.
	* testsuite/20_util/monotonic_buffer_resource/deallocate.cc: New test.
	* testsuite/20_util/monotonic_buffer_resource/release.cc: New test.
	* testsuite/20_util/monotonic_buffer_resource/upstream_resource.cc:
	New test.
	* testsuite/20_util/polymorphic_allocator/1.cc: New test.
	* testsuite/20_util/polymorphic_allocator/resource.cc: New test.
	* testsuite/20_util/polymorphic_allocator/select.cc: New test.
	* testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource):
	Define concrete memory resource for testing.
	(__gnu_test::default_resource_mgr): Define RAII helper for changing
	default resource.

Added:
    trunk/libstdc++-v3/include/std/memory_resource
    trunk/libstdc++-v3/src/c++17/
    trunk/libstdc++-v3/src/c++17/Makefile.am
      - copied, changed from r262952, trunk/libstdc++-v3/src/c++11/Makefile.am
    trunk/libstdc++-v3/src/c++17/Makefile.in
    trunk/libstdc++-v3/src/c++17/memory_resource.cc
    trunk/libstdc++-v3/testsuite/20_util/memory_resource/
    trunk/libstdc++-v3/testsuite/20_util/memory_resource/1.cc
    trunk/libstdc++-v3/testsuite/20_util/memory_resource/2.cc
    trunk/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/
    trunk/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/1.cc
    trunk/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/allocate.cc
    trunk/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/deallocate.cc
    trunk/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/release.cc
    trunk/libstdc++-v3/testsuite/20_util/monotonic_buffer_resource/upstream_resource.cc
    trunk/libstdc++-v3/testsuite/20_util/polymorphic_allocator/
    trunk/libstdc++-v3/testsuite/20_util/polymorphic_allocator/1.cc
    trunk/libstdc++-v3/testsuite/20_util/polymorphic_allocator/resource.cc
    trunk/libstdc++-v3/testsuite/20_util/polymorphic_allocator/select.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/config/abi/pre/gnu.ver
    trunk/libstdc++-v3/configure
    trunk/libstdc++-v3/include/Makefile.am
    trunk/libstdc++-v3/include/Makefile.in
    trunk/libstdc++-v3/include/precompiled/stdc++.h
    trunk/libstdc++-v3/src/Makefile.am
    trunk/libstdc++-v3/src/Makefile.in
    trunk/libstdc++-v3/src/c++11/Makefile.am
    trunk/libstdc++-v3/testsuite/util/testsuite_allocator.h



More information about the Libstdc++-cvs mailing list