From: Jeff Preshing Date: Mon, 15 Feb 2016 23:46:26 +0000 (-0500) Subject: Check that Redirect is not passed to exchange() X-Git-Url: http://plrg.eecs.uci.edu/git/?p=junction.git;a=commitdiff_plain;h=9ff6f541ec9e73851a127ebcf465025e514ff7f6 Check that Redirect is not passed to exchange() --- diff --git a/junction/ConcurrentMap_Grampa.h b/junction/ConcurrentMap_Grampa.h index 8d67f22..27e18ff 100644 --- a/junction/ConcurrentMap_Grampa.h +++ b/junction/ConcurrentMap_Grampa.h @@ -335,6 +335,7 @@ public: Value exchangeValue(Value desired) { TURF_ASSERT(desired != Value(ValueTraits::NullValue)); + TURF_ASSERT(desired != Value(ValueTraits::Redirect)); TURF_ASSERT(m_cell); // Cell must have been found or inserted TURF_TRACE(ConcurrentMap_Grampa, 14, "[Mutator::exchangeValue] called", uptr(m_table), uptr(m_value)); for (;;) { diff --git a/junction/ConcurrentMap_LeapFrog.h b/junction/ConcurrentMap_LeapFrog.h index 389ce40..f6b1e6c 100644 --- a/junction/ConcurrentMap_LeapFrog.h +++ b/junction/ConcurrentMap_LeapFrog.h @@ -133,6 +133,7 @@ public: Value exchangeValue(Value desired) { TURF_ASSERT(desired != Value(ValueTraits::NullValue)); + TURF_ASSERT(desired != Value(ValueTraits::Redirect)); TURF_ASSERT(m_cell); // Cell must have been found or inserted TURF_TRACE(ConcurrentMap_LeapFrog, 4, "[Mutator::exchangeValue] called", uptr(m_table), uptr(m_value)); for (;;) { diff --git a/junction/ConcurrentMap_Linear.h b/junction/ConcurrentMap_Linear.h index 3450807..b93d86e 100644 --- a/junction/ConcurrentMap_Linear.h +++ b/junction/ConcurrentMap_Linear.h @@ -135,6 +135,7 @@ public: Value exchangeValue(Value desired) { TURF_ASSERT(desired != Value(ValueTraits::NullValue)); + TURF_ASSERT(desired != Value(ValueTraits::Redirect)); TURF_ASSERT(m_cell); // Cell must have been found or inserted TURF_TRACE(ConcurrentMap_Linear, 4, "[Mutator::exchangeValue] called", uptr(m_table), uptr(m_value)); bool mustDouble = false; diff --git a/junction/extra/MapAdapter.h b/junction/extra/MapAdapter.h index 9897d94..a59ddd1 100644 --- a/junction/extra/MapAdapter.h +++ b/junction/extra/MapAdapter.h @@ -16,7 +16,7 @@ #include #ifndef JUNCTION_IMPL_MAPADAPTER_PATH -#define JUNCTION_IMPL_MAPADAPTER_PATH "junction/extra/impl/MapAdapter_Grampa.h" +#define JUNCTION_IMPL_MAPADAPTER_PATH "junction/extra/impl/MapAdapter_Linear.h" #endif #include JUNCTION_IMPL_MAPADAPTER_PATH