|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77238 - in sandbox-branches/optional_optimization: boost/optional libs/optional/test
From: C.Hite_at_[hidden]
Date: 2012-03-05 14:43:15
Author: chris_hite
Date: 2012-03-05 14:43:14 EST (Mon, 05 Mar 2012)
New Revision: 77238
URL: http://svn.boost.org/trac/boost/changeset/77238
Log:
used dtor_optimized in destroy for branch free destroy
Text files modified:
sandbox-branches/optional_optimization/boost/optional/optional.hpp | 4 +++-
sandbox-branches/optional_optimization/libs/optional/test/optional_test_trivial_assertions.cpp | 18 +++++++++++-------
2 files changed, 14 insertions(+), 8 deletions(-)
Modified: sandbox-branches/optional_optimization/boost/optional/optional.hpp
==============================================================================
--- sandbox-branches/optional_optimization/boost/optional/optional.hpp (original)
+++ sandbox-branches/optional_optimization/boost/optional/optional.hpp 2012-03-05 14:43:14 EST (Mon, 05 Mar 2012)
@@ -453,7 +453,9 @@
void destroy()
{
- if ( m_initialized ){
+ if( dtor_optimized::value )
+ m_initialized = false ;
+ else if ( m_initialized ){
destroy_impl(is_reference_predicate()) ;
m_initialized = false ;
}
Modified: sandbox-branches/optional_optimization/libs/optional/test/optional_test_trivial_assertions.cpp
==============================================================================
--- sandbox-branches/optional_optimization/libs/optional/test/optional_test_trivial_assertions.cpp (original)
+++ sandbox-branches/optional_optimization/libs/optional/test/optional_test_trivial_assertions.cpp 2012-03-05 14:43:14 EST (Mon, 05 Mar 2012)
@@ -36,14 +36,18 @@
-
/*
-has_trivial_assign
-has_trivial_constructor
-has_trivial_copy
-has_trivial_copy_constructor
-has_trivial_default_constructor
-has_trivial_destructor
+ * The code generated below can be looked at with objdump to see if it is suboptimal
*/
+void assign_optional_int(oi& x,oi& y){
+ x=y;
+}
+
+void reset_optional_int(oi& x){
+ x=boost::none;
+}
+
+
+
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk