Define monotonic_buffer_resource members out-of-line
commit7127dfbd2e7728ee7ec7c26d887c6ea8061dfd77
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Aug 2018 11:31:16 +0000 (7 11:31 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Aug 2018 11:31:16 +0000 (7 11:31 +0000)
tree62957004c39724b8ca85a29f12c56aa450b58fae
parent81cb8a0cbbb173717ca60eebcb32db06a3676b0e
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263354 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/include/std/memory_resource
libstdc++-v3/src/c++17/memory_resource.cc