public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Extend aligned_membuf<> usage
@ 2018-02-01 21:48 François Dumont
  2018-02-05 17:16 ` Jonathan Wakely
  0 siblings, 1 reply; 6+ messages in thread
From: François Dumont @ 2018-02-01 21:48 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 143 bytes --]

Hi

     As we just bump version namespace it might be interesting to do the 
following change now. What do you think ?

François


[-- Attachment #2: aligned_membuf.patch --]
[-- Type: text/x-patch, Size: 1881 bytes --]

diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h
index 56b3ac5..05abd43 100644
--- a/libstdc++-v3/include/bits/forward_list.h
+++ b/libstdc++-v3/include/bits/forward_list.h
@@ -116,7 +116,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       {
 	_Fwd_list_node() = default;
 
+#if _GLIBCXX_INLINE_VERSION
+	__gnu_cxx::__aligned_membuf<_Tp> _M_storage;
+#else
 	__gnu_cxx::__aligned_buffer<_Tp> _M_storage;
+#endif
 
 	_Tp*
 	_M_valptr() noexcept
diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h
index 3ff6b14..222a1b2 100644
--- a/libstdc++-v3/include/bits/hashtable_policy.h
+++ b/libstdc++-v3/include/bits/hashtable_policy.h
@@ -231,7 +231,11 @@ namespace __detail
     {
       typedef _Value value_type;
 
+#if _GLIBCXX_INLINE_VERSION
+      __gnu_cxx::__aligned_membuf<_Value> _M_storage;
+#else
       __gnu_cxx::__aligned_buffer<_Value> _M_storage;
+#endif
 
       _Value*
       _M_valptr() noexcept
@@ -1516,7 +1520,11 @@ namespace __detail
   template<typename _Tp, bool _IsEmpty = std::is_empty<_Tp>::value>
     struct _Hash_code_storage
     {
+#if _GLIBCXX_INLINE_VERSION
+      __gnu_cxx::__aligned_membuf<_Tp> _M_storage;
+#else
       __gnu_cxx::__aligned_buffer<_Tp> _M_storage;
+#endif
 
       _Tp*
       _M_h() { return _M_storage._M_ptr(); }
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index b58273a..8e00f1b 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -534,7 +534,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 	_Alloc& _M_alloc() noexcept { return _A_base::_S_get(*this); }
 
+#if _GLIBCXX_INLINE_VERSION
+	__gnu_cxx::__aligned_membuf<_Tp> _M_storage;
+#else
 	__gnu_cxx::__aligned_buffer<_Tp> _M_storage;
+#endif
       };
 
     public:

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-20 21:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-01 21:48 Extend aligned_membuf<> usage François Dumont
2018-02-05 17:16 ` Jonathan Wakely
2018-02-06 19:16   ` François Dumont
2018-02-08  6:10     ` François Dumont
2018-02-20 19:59       ` Jonathan Wakely
2018-02-20 21:00         ` François Dumont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).