Remove unused vars
[libcds.git] / cds / memory / michael / allocator.h
index f7efa001fbc07bcb8d05a5c19ad7adb8e149030c..4ddfb1b34a401d363dd3f2fc88f0df3e74b4425b 100644 (file)
@@ -15,6 +15,8 @@
     2011.01.02 khizmax  Created
 */
 
+#include <stdlib.h>
+#include <mutex>        // unique_lock
 #include <cds/init.h>
 #include <cds/memory/michael/options.h>
 #include <cds/memory/michael/bound_check.h>
@@ -30,7 +32,6 @@
 #include <cds/user_setup/cache_line.h>
 #include <cds/details/lib.h>
 
-#include <stdlib.h>
 #include <boost/intrusive/list.hpp>
 
 namespace cds {
@@ -144,14 +145,14 @@ namespace michael {
             }
         };
 #endif
-
-        typedef container::VyukovMPMCCycleQueue<
-            void *,
-            opt::buffer< opt::v::static_buffer<void *, FreeListCapacity> >
+        struct free_list_traits : public cds::container::vyukov_queue::traits
+        {
+            typedef opt::v::static_buffer<void *, FreeListCapacity> buffer;
 #ifdef _DEBUG
-            , opt::value_cleaner< make_null_ptr >
+            typedef make_null_ptr value_cleaner;
 #endif
-        >   free_list;
+        };
+        typedef container::VyukovMPMCCycleQueue< void *, free_list_traits > free_list;
 
         free_list   m_FreeList;
         //@endcond
@@ -306,7 +307,7 @@ namespace michael {
         typedef details::free_list_locked_hook item_hook;
         typedef Lock lock_type;
     protected:
-        typedef cds::lock::scoped_lock<lock_type>   auto_lock;
+        typedef std::unique_lock<lock_type>   auto_lock;
 
         mutable lock_type   m_access;
         //@endcond
@@ -360,7 +361,7 @@ namespace michael {
         typedef details::partial_list_locked_hook item_hook;
         typedef Lock    lock_type;
     protected:
-        typedef cds::lock::scoped_lock<lock_type>   auto_lock;
+        typedef std::unique_lock<lock_type>   auto_lock;
 
         mutable lock_type   m_access;
         //@endcond
@@ -967,15 +968,13 @@ namespace michael {
                 , nCredits(0)
             {}
 
-#   ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
-            active_tag( active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
-            ~active_tag() CDS_NOEXCEPT_DEFAULTED = default;
-            active_tag& operator=(active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
-#       if defined(CDS_MOVE_SEMANTICS_SUPPORT) && !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
-            active_tag( active_tag&& ) CDS_NOEXCEPT_DEFAULTED = default;
-            active_tag& operator=(active_tag&&) CDS_NOEXCEPT_DEFAULTED = default;
+            active_tag( active_tag const& ) CDS_NOEXCEPT = default;
+            ~active_tag() CDS_NOEXCEPT = default;
+            active_tag& operator=(active_tag const& ) CDS_NOEXCEPT = default;
+#       if !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
+            active_tag( active_tag&& ) CDS_NOEXCEPT = default;
+            active_tag& operator=(active_tag&&) CDS_NOEXCEPT = default;
 #       endif
-#   endif
 
             /// Returns pointer to superblock descriptor
             superblock_desc * ptr() const
@@ -1026,17 +1025,15 @@ namespace michael {
             active_tag() CDS_NOEXCEPT
                 : pDesc( nullptr )
             {}
-#   ifdef CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT
             // Clang 3.1: error: first argument to atomic operation must be a pointer to a trivially-copyable type
-            //active_tag() CDS_NOEXCEPT_DEFAULTED = default;
-            active_tag( active_tag const& ) CDS_NOEXCEPT_DEFAULTED = default;
-            ~active_tag() CDS_NOEXCEPT_DEFAULTED = default;
-            active_tag& operator=(active_tag const&) CDS_NOEXCEPT_DEFAULTED = default;
-#       if defined(CDS_MOVE_SEMANTICS_SUPPORT) && !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
-            active_tag( active_tag&& ) CDS_NOEXCEPT_DEFAULTED = default;
-            active_tag& operator=(active_tag&&) CDS_NOEXCEPT_DEFAULTED = default;
+            //active_tag() CDS_NOEXCEPT = default;
+            active_tag( active_tag const& ) CDS_NOEXCEPT = default;
+            ~active_tag() CDS_NOEXCEPT = default;
+            active_tag& operator=(active_tag const&) CDS_NOEXCEPT = default;
+#       if !defined(CDS_DISABLE_DEFAULT_MOVE_CTOR)
+            active_tag( active_tag&& ) CDS_NOEXCEPT = default;
+            active_tag& operator=(active_tag&&) CDS_NOEXCEPT = default;
 #       endif
-#   endif
             superblock_desc *    ptr() const
             {
                 return pDesc.ptr();
@@ -1423,6 +1420,7 @@ namespace michael {
         /// Allocates new processor descriptor
         processor_desc * new_processor_desc( unsigned int nProcessorId )
         {
+            CDS_UNUSED( nProcessorId );
             processor_desc * pDesc;
             const size_t nPageHeapCount = m_SizeClassSelector.pageTypeCount();