replace cds::gc::too_few_hazard_pointers exception with std::overflow
authorkhizmax <khizmax@gmail.com>
Fri, 14 Nov 2014 10:18:15 +0000 (13:18 +0300)
committerkhizmax <khizmax@gmail.com>
Fri, 14 Nov 2014 10:18:15 +0000 (13:18 +0300)
cds/gc/exception.h [deleted file]
cds/gc/hp_decl.h
cds/gc/hzp/hzp.h
projects/Win/vc12/cds.vcxproj
projects/Win/vc12/cds.vcxproj.filters

diff --git a/cds/gc/exception.h b/cds/gc/exception.h
deleted file mode 100644 (file)
index 797bbb6..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-//$$CDS-header$$
-
-#ifndef __CDS_GC_EXCEPTION_H
-#define __CDS_GC_EXCEPTION_H
-
-#include <cds/details/defs.h>
-
-namespace cds { namespace gc {
-
-    /// %Exception "Too few hazard pointers"
-    CDS_DECLARE_EXCEPTION( too_few_hazard_pointers, "Too few hazard pointers" );
-
-}} // namespace cds::gc
-
-#endif // #ifndef __CDS_GC_EXCEPTION_H
index 46df3a1..2b92a54 100644 (file)
@@ -3,6 +3,7 @@
 #ifndef __CDS_GC_HP_DECL_H
 #define __CDS_GC_HP_DECL_H
 
+#include <stdexcept>    // overflow_error
 #include <cds/gc/hzp/hzp.h>
 #include <cds/details/marked_ptr.h>
 
@@ -372,14 +373,15 @@ namespace cds { namespace gc {
 
         /// Checks if count of hazard pointer is no less than \p nCountNeeded
         /**
-            If \p bRaiseException is \p true (that is the default), the function raises an exception gc::too_few_hazard_pointers
+            If \p bRaiseException is \p true (that is the default), the function raises 
+            an \p std::overflow_error exception "Too few hazard pointers"
             if \p nCountNeeded is more than the count of hazard pointer per thread.
         */
         static bool check_available_guards( size_t nCountNeeded, bool bRaiseException = true )
         {
             if ( hzp::GarbageCollector::instance().getHazardPointerCount() < nCountNeeded ) {
                 if ( bRaiseException )
-                    throw cds::gc::too_few_hazard_pointers();
+                    throw std::overflow_error( "Too few hazard pointers" );
                 return false;
             }
             return true;
index a3ccf66..b92a5a4 100644 (file)
@@ -6,7 +6,6 @@
 #include <vector>
 #include <cds/cxx11_atomic.h>
 #include <cds/os/thread.h>
-#include <cds/gc/exception.h>
 #include <cds/gc/hzp/details/hp_fwd.h>
 #include <cds/gc/hzp/details/hp_alloc.h>
 #include <cds/gc/hzp/details/hp_retired.h>
index c82a2cb..b9b19b9 100644 (file)
     <ClInclude Include="..\..\..\cds\details\static_functor.h" />\r
     <ClInclude Include="..\..\..\cds\gc\all.h" />\r
     <ClInclude Include="..\..\..\cds\gc\dhp.h" />\r
-    <ClInclude Include="..\..\..\cds\gc\exception.h" />\r
     <ClInclude Include="..\..\..\cds\gc\gc_fwd.h" />\r
     <ClInclude Include="..\..\..\cds\gc\guarded_ptr.h" />\r
     <ClInclude Include="..\..\..\cds\gc\hp_decl.h" />\r
index e7b7f7e..893eb2d 100644 (file)
     <ClInclude Include="..\..\..\cds\container\cuckoo_map.h">\r
       <Filter>Header Files\cds\container</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\..\..\cds\gc\exception.h">\r
-      <Filter>Header Files\cds\gc</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="..\..\..\cds\intrusive\skip_list_hp.h">\r
       <Filter>Header Files\cds\intrusive</Filter>\r
     </ClInclude>\r