Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66611 - in sandbox/function/boost/function: . detail
From: dsaritz_at_[hidden]
Date: 2010-11-16 04:28:58


Author: psiha
Date: 2010-11-16 04:28:54 EST (Tue, 16 Nov 2010)
New Revision: 66611
URL: http://svn.boost.org/trac/boost/changeset/66611

Log:
Minor refactoring and optimization.
Text files modified:
   sandbox/function/boost/function/detail/platform_specifics.hpp | 12 ++++++++----
   sandbox/function/boost/function/function_base.hpp | 26 ++++++++++----------------
   2 files changed, 18 insertions(+), 20 deletions(-)

Modified: sandbox/function/boost/function/detail/platform_specifics.hpp
==============================================================================
--- sandbox/function/boost/function/detail/platform_specifics.hpp (original)
+++ sandbox/function/boost/function/detail/platform_specifics.hpp 2010-11-16 04:28:54 EST (Tue, 16 Nov 2010)
@@ -46,7 +46,8 @@
     #define BF_CDECL __cdecl
     #define BF_FASTCALL __fastcall
 
- #define BF_RESTRICT __restrict
+ #define BF_POINTER_RESTRICT __restrict
+ #define BF_REFERENCE_RESTRICT
 
     #define BF_FORCEINLINE __forceinline
     #define BF_NOINLINE __declspec( noinline )
@@ -84,7 +85,8 @@
     #define BF_CDECL __attribute__(( cdecl ))
     #define BF_FASTCALL __attribute__(( fastcall ))
 
- #define BF_RESTRICT
+ #define BF_POINTER_RESTRICT __restrict
+ #define BF_REFERENCE_RESTRICT __restrict
 
     #ifdef _DEBUG
         #define BF_FORCEINLINE inline
@@ -124,7 +126,8 @@
     #define BF_CDECL __cdecl
     #define BF_FASTCALL __fastcall
 
- #define BF_RESTRICT
+ #define BF_POINTER_RESTRICT
+ #define BF_REFERENCE_RESTRICT
 
     #define BF_FORCEINLINE inline
     #define BF_NOINLINE
@@ -153,7 +156,8 @@
     #define BF_CDECL
     #define BF_FASTCALL
 
- #define BF_RESTRICT
+ #define BF_POINTER_RESTRICT
+ #define BF_REFERENCE_RESTRICT
 
     #define BF_FORCEINLINE inline
     #define BF_NOINLINE

Modified: sandbox/function/boost/function/function_base.hpp
==============================================================================
--- sandbox/function/boost/function/function_base.hpp (original)
+++ sandbox/function/boost/function/function_base.hpp 2010-11-16 04:28:54 EST (Tue, 16 Nov 2010)
@@ -302,16 +302,13 @@
        * object pointers, and a structure that resembles a bound
        * member function pointer.
        */
- #ifdef BOOST_MSVC
- // http://msdn.microsoft.com/en-us/library/5ft82fed(VS.80).aspx (ad unions)
- #define BF_AUX_RESTRICT __restrict
- #else
- #define BF_AUX_RESTRICT
- #endif
+
+ // http://msdn.microsoft.com/en-us/library/5ft82fed(VS.80).aspx (ad unions)
+
       union function_buffer
       {
         // For pointers to function objects
- void * BF_AUX_RESTRICT obj_ptr;
+ void * BF_POINTER_RESTRICT obj_ptr;
 
         // For 'trivial' function objects (that can be managed without type
         // information) that must be allocated on the heap (we must only save
@@ -323,19 +320,17 @@
         } trivial_heap_obj;
 
         // For function pointers of all kinds
- void (* BF_AUX_RESTRICT func_ptr)();
+ void (* BF_POINTER_RESTRICT func_ptr)();
 
         // For bound member pointers
         struct bound_memfunc_ptr_t {
           class X;
- void (X::* BF_AUX_RESTRICT memfunc_ptr)(int);
+ void (X::* BF_POINTER_RESTRICT memfunc_ptr)(int);
           void * obj_ptr;
         } bound_memfunc_ptr;
 
- // To relax aliasing constraints
- char data;
+ double max_alignment_helper;
       };
- #undef BF_AUX_RESTRICT
 
       // A simple wrapper to allow deriving and a thiscall invoker.
       struct function_buffer_holder { function_buffer buffer; };
@@ -1003,10 +998,9 @@
         template<typename TargetInvokerType>
         TargetInvokerType const & invoker() const { return reinterpret_cast<TargetInvokerType const &>( void_invoker ); }
 
- void clone ( function_buffer const & in_buffer, function_buffer & out_buffer ) const { do_clone( in_buffer, out_buffer ); }
- void move ( function_buffer & in_buffer, function_buffer & out_buffer ) const { do_move ( in_buffer, out_buffer ); }
- BF_NOTHROW
- void destroy( function_buffer & buffer ) const { do_destroy( buffer ); }
+ void BF_NOALIAS clone ( function_buffer const & in_buffer, function_buffer & out_buffer ) const { do_clone( in_buffer, out_buffer ); }
+ void BF_NOALIAS move ( function_buffer & in_buffer, function_buffer & out_buffer ) const { do_move ( in_buffer, out_buffer ); }
+ void BF_NOTHROWNOALIAS destroy( function_buffer & buffer ) const { do_destroy( buffer ); }
 
         // The possibly-decorated-invoker-wrapper is not used here because MSVC
         // (9.0 SP1) needlessly copy-constructs the returned typed_functor


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