From b65fbe8b7a5f8b7615932a1aa2507b9155c12027 Mon Sep 17 00:00:00 2001 From: khizmax Date: Fri, 14 Nov 2014 13:18:15 +0300 Subject: [PATCH] replace cds::gc::too_few_hazard_pointers exception with std::overflow --- cds/gc/exception.h | 15 --------------- cds/gc/hp_decl.h | 6 ++++-- cds/gc/hzp/hzp.h | 1 - projects/Win/vc12/cds.vcxproj | 1 - projects/Win/vc12/cds.vcxproj.filters | 3 --- 5 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 cds/gc/exception.h diff --git a/cds/gc/exception.h b/cds/gc/exception.h deleted file mode 100644 index 797bbb6b..00000000 --- a/cds/gc/exception.h +++ /dev/null @@ -1,15 +0,0 @@ -//$$CDS-header$$ - -#ifndef __CDS_GC_EXCEPTION_H -#define __CDS_GC_EXCEPTION_H - -#include - -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 diff --git a/cds/gc/hp_decl.h b/cds/gc/hp_decl.h index 46df3a14..2b92a540 100644 --- a/cds/gc/hp_decl.h +++ b/cds/gc/hp_decl.h @@ -3,6 +3,7 @@ #ifndef __CDS_GC_HP_DECL_H #define __CDS_GC_HP_DECL_H +#include // overflow_error #include #include @@ -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; diff --git a/cds/gc/hzp/hzp.h b/cds/gc/hzp/hzp.h index a3ccf66c..b92a5a41 100644 --- a/cds/gc/hzp/hzp.h +++ b/cds/gc/hzp/hzp.h @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/projects/Win/vc12/cds.vcxproj b/projects/Win/vc12/cds.vcxproj index c82a2cb9..b9b19b93 100644 --- a/projects/Win/vc12/cds.vcxproj +++ b/projects/Win/vc12/cds.vcxproj @@ -736,7 +736,6 @@ - diff --git a/projects/Win/vc12/cds.vcxproj.filters b/projects/Win/vc12/cds.vcxproj.filters index e7b7f7ea..893eb2df 100644 --- a/projects/Win/vc12/cds.vcxproj.filters +++ b/projects/Win/vc12/cds.vcxproj.filters @@ -836,9 +836,6 @@ Header Files\cds\container - - Header Files\cds\gc - Header Files\cds\intrusive -- 2.34.1