From 993e7e5146f39ff0ed459ac0a8bc30e7a0253156 Mon Sep 17 00:00:00 2001 From: Peizhao Ou Date: Sat, 21 Mar 2015 05:35:18 -0700 Subject: [PATCH] changes --- concurrent-hashmap/Makefile | 3 ++- concurrent-hashmap/hashmap.h | 19 ++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/concurrent-hashmap/Makefile b/concurrent-hashmap/Makefile index 89e5244..645b54a 100644 --- a/concurrent-hashmap/Makefile +++ b/concurrent-hashmap/Makefile @@ -5,7 +5,8 @@ NORMAL_TESTS := testcase1 testcase2 testcase3 WILDCARD_TESTS := $(patsubst %, %_wildcard, $(NORMAL_TESTS)) -TESTS := $(NORMAL_TESTS) $(WILDCARD_TESTS) +#TESTS := $(NORMAL_TESTS) $(WILDCARD_TESTS) +TESTS := $(NORMAL_TESTS) all: $(TESTS) diff --git a/concurrent-hashmap/hashmap.h b/concurrent-hashmap/hashmap.h index 0d24925..68dd815 100644 --- a/concurrent-hashmap/hashmap.h +++ b/concurrent-hashmap/hashmap.h @@ -5,17 +5,10 @@ #include #include "stdio.h" //#include -#ifdef STANDALONE -#include -#define MODEL_ASSERT assert -#else -#include -#endif #include #include -#include "common.h" -#include "sc_annotation.h" +//#include "sc_annotation.h" #define relaxed memory_order_relaxed #define release memory_order_release @@ -149,7 +142,7 @@ class HashMap { } Value* get(Key *key) { - MODEL_ASSERT (key); + //MODEL_ASSERT (key); int hash = hashKey(key); // Try first without locking... @@ -165,9 +158,9 @@ class HashMap { // lock, we ignore this operation for the SC analysis, and otherwise we // take it into consideration - SC_BEGIN(); + //SC_BEGIN(); Entry *firstPtr = first->load(acquire); - SC_END(); + //SC_END(); e = firstPtr; while (e != NULL) { @@ -209,7 +202,7 @@ class HashMap { Value* put(Key *key, Value *value) { // Don't allow NULL key or value - MODEL_ASSERT (key && value); + //MODEL_ASSERT (key && value); int hash = hashKey(key); Segment *seg = segments[hash & SEGMENT_MASK]; @@ -248,7 +241,7 @@ class HashMap { } Value* remove(Key *key, Value *value) { - MODEL_ASSERT (key); + //MODEL_ASSERT (key); int hash = hashKey(key); Segment *seg = segments[hash & SEGMENT_MASK]; atomic *tab; -- 2.34.1