]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR libstdc++/80285 optimize std::make_shared for -fno-rtti
authorJonathan Wakely <jwakely@redhat.com>
Thu, 11 May 2017 13:21:07 +0000 (14:21 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 11 May 2017 13:21:07 +0000 (14:21 +0100)
commitf8cba3aaaef329e00f8af4364765274205402be9
tree764714d31d91c426d61f6a43b855c705c688f52e
parent29b871ec5e1da82a58a6f58b575395dd07ff0050
PR libstdc++/80285 optimize std::make_shared for -fno-rtti

PR libstdc++/80285
* include/bits/shared_ptr_base.h (_Sp_make_shared_tag::_S_ti): Define
function to get unique fake std::type_info reference.
(_Sp_counted_ptr_inplace::_M_get_deleter) [!__cpp_rtti]: Compare to
_S_ti() fake reference.
(__shared_ptr(_Sp_make_shared_tag, const Alloc&, Args&&...)): Share
single implementation with or without RTTI enable.
[!__cpp_rtti]: Pass fake reference to _M_get_deleter.
* testsuite/20_util/shared_ptr/creation/alloc.cc: Change expected
allocation and deallocation counts.
* testsuite/20_util/shared_ptr/creation/single_allocation.cc: New.
* testsuite/20_util/shared_ptr/creation/single_allocation_no_rtti.cc:
New.

From-SVN: r247905
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/shared_ptr_base.h
libstdc++-v3/testsuite/20_util/shared_ptr/creation/alloc.cc
libstdc++-v3/testsuite/20_util/shared_ptr/creation/single_allocation.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/shared_ptr/creation/single_allocation_no_rtti.cc [new file with mode: 0644]