aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2010-10-08 20:30:44 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2010-10-08 20:30:44 +0000
commit0fd76d8e4c34b647eec8fcd7c8b797b8559301e0 (patch)
tree9da00e0862c14bafa99e669a57ce7251801cc0f7
parentbd39cb5225a1a8b3a7ac15ef7a50231205a64ff8 (diff)
downloadgcc-0fd76d8e4c34b647eec8fcd7c8b797b8559301e0.zip
gcc-0fd76d8e4c34b647eec8fcd7c8b797b8559301e0.tar.gz
gcc-0fd76d8e4c34b647eec8fcd7c8b797b8559301e0.tar.bz2
future (_Result_alloc): Derive from _Alloc, exploit the Empty Base Optimization.
2010-10-08 Paolo Carlini <paolo.carlini@oracle.com> * include/std/future (_Result_alloc): Derive from _Alloc, exploit the Empty Base Optimization. From-SVN: r165194
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/std/future8
2 files changed, 8 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 172eb5b..b4ca4f2 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/future (_Result_alloc): Derive from _Alloc,
+ exploit the Empty Base Optimization.
+
2010-10-08 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/45403
diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
index ff56698..2933c8b 100644
--- a/libstdc++-v3/include/std/future
+++ b/libstdc++-v3/include/std/future
@@ -215,24 +215,22 @@ namespace std
/// Result_alloc.
template<typename _Res, typename _Alloc>
- struct _Result_alloc : _Result<_Res>
+ struct _Result_alloc : _Result<_Res>, _Alloc
{
typedef typename _Alloc::template rebind<_Result_alloc>::other
__allocator_type;
explicit
- _Result_alloc(const _Alloc& __a) : _Result<_Res>(), _M_alloc(__a)
+ _Result_alloc(const _Alloc& __a) : _Result<_Res>(), _Alloc(__a)
{ }
private:
void _M_destroy()
{
- __allocator_type __a(_M_alloc);
+ __allocator_type __a(*this);
__a.destroy(this);
__a.deallocate(this, 1);
}
-
- __allocator_type _M_alloc;
};
template<typename _Res, typename _Allocator>