On 07/11/18 19:55 +0100, Rainer Orth wrote:
Hi Jonathan,
Implement std::pmr::unsynchronized_pool_resource
* config/abi/pre/gnu.ver: Add new symbols.
* include/std/memory_resource (std::pmr::__pool_resource): New class.
(std::pmr::unsynchronized_pool_resource): New class.
* src/c++17/Makefile.am: Add -fimplicit-templates to flags for
memory_resource.cc
* src/c++17/Makefile.in: Regenerate.
* src/c++17/memory_resource.cc (bitset, chunk, big_block): New
internal classes.
(__pool_resource::_Pool): Define new class.
(munge_options, pool_index, select_num_pools): New internal functions.
(__pool_resource::__pool_resource, __pool_resource::~__pool_resource)
(__pool_resource::allocate, __pool_resource::deallocate)
(__pool_resource::_M_alloc_pools): Define member functions.
(unsynchronized_pool_resource::unsynchronized_pool_resource)
(unsynchronized_pool_resource::~unsynchronized_pool_resource)
(unsynchronized_pool_resource::release)
(unsynchronized_pool_resource::_M_find_pool)
(unsynchronized_pool_resource::do_allocate)
(unsynchronized_pool_resource::do_deallocate): Define member
functions.
* testsuite/20_util/unsynchronized_pool_resource/allocate.cc: New
test.
* testsuite/20_util/unsynchronized_pool_resource/is_equal.cc: New
test.
* testsuite/20_util/unsynchronized_pool_resource/options.cc: New
test.
* testsuite/20_util/unsynchronized_pool_resource/release.cc: New
test.
The new tests being added here are pretty minimal, because we can't
assume machines running the testsuite will be able to allocate large
amounts of memory. I've tested it more thoroughly with much larger
tests though, and will try to get some of them in shape for the
testsuite/performance/20_util directory.
Tested powerpc64le-linux. Committed to trunk.
two of the new tests FAIL on 32-bit targets (seen on
i386-pc-solaris2.11, but there are other reports as well):
+FAIL: 20_util/unsynchronized_pool_resource/allocate.cc (test for excess errors)
+UNRESOLVED: 20_util/unsynchronized_pool_resource/allocate.cc compilation
failed to produce executable
Excess errors:
Undefined first referenced
symbol in file
std::pmr::unsynchronized_pool_resource::do_deallocate(void*, unsigned int,
unsigned int) /var/tmp//ccUR6CSd.o
std::pmr::unsynchronized_pool_resource::do_allocate(unsigned int, unsigned int)
/var/tmp//ccUR6CSd.o
ld: fatal: symbol referencing errors
+FAIL: 20_util/unsynchronized_pool_resource/release.cc (test for excess errors)
+UNRESOLVED: 20_util/unsynchronized_pool_resource/release.cc compilation failed
to produce executable
Excess errors:
Undefined first referenced
symbol in file
std::pmr::unsynchronized_pool_resource::do_allocate(unsigned int, unsigned int)
/var/tmp//ccrQoKEb.o
ld: fatal: symbol referencing errors
Sorry about that, should be fixed by this patch. Committed to trunk.
commit f36c97256c4173516116f4c64c39c81ffec98d70
Author: Jonathan Wakely <jwak...@redhat.com>
Date: Wed Nov 7 19:07:26 2018 +0000
Fix linker script to use [jmy] to match size_t parameters
* config/abi/pre/gnu.ver: Fix patterns for size_t parameters.
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index b55038b8845..9d66f908e1a 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -2061,8 +2061,8 @@ GLIBCXX_3.4.26 {
_ZNSt3pmr28unsynchronized_pool_resourceC[12]ERKNS_12pool_optionsEPNS_15memory_resourceE;
_ZNSt3pmr28unsynchronized_pool_resourceD[12]Ev;
_ZNSt3pmr28unsynchronized_pool_resource7releaseEv;
- _ZNSt3pmr28unsynchronized_pool_resource11do_allocateEmm;
- _ZNSt3pmr28unsynchronized_pool_resource13do_deallocateEPvmm;
+ _ZNSt3pmr28unsynchronized_pool_resource11do_allocateE[jmy][jmy];
+ _ZNSt3pmr28unsynchronized_pool_resource13do_deallocateEPv[jmy][jmy];
} GLIBCXX_3.4.25;