Define monotonic_buffer_resource members out-of-line
authorJonathan Wakely <jwakely@redhat.com>
Tue, 7 Aug 2018 11:31:16 +0000 (12:31 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 7 Aug 2018 11:31:16 +0000 (12:31 +0100)
commitea2329d170827cf9d321324844035a4a2dcfec96
tree62957004c39724b8ca85a29f12c56aa450b58fae
parent4c9291262affd31e66dec1c8af607e07a8ce2904
Define monotonic_buffer_resource members out-of-line

Move the allocation logic into libstdc++.so so that it can be changed
without worrying about inlined code in existing binaries.

Leave do_allocate inline so that calls to it can be devirtualized, and
only the slow path needs to call into the library.

* config/abi/pre/gnu.ver: Export monotonic_buffer_resource members.
* include/std/memory_resource (monotonic_buffer_resource::release):
Call _M_release_buffers to free buffers.
(monotonic_buffer_resource::do_allocate): Call _M_new_buffer to
allocate a new buffer from upstream.
(monotonic_buffer_resource::_M_new_buffer): Declare.
(monotonic_buffer_resource::_M_release_buffers): Declare.
(monotonic_buffer_resource::_Chunk): Replace definition with
declaration as opaque type.
* src/c++17/memory_resource.cc (monotonic_buffer_resource::_Chunk):
Define.
(monotonic_buffer_resource::_M_new_buffer): Define.
(monotonic_buffer_resource::_M_release_buffers): Define.

From-SVN: r263354
libstdc++-v3/ChangeLog
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/include/std/memory_resource
libstdc++-v3/src/c++17/memory_resource.cc