From 543ede7e3eaac62c14a061296722839829b0cef8 Mon Sep 17 00:00:00 2001 From: Jarno Rajahalme Date: Wed, 19 Mar 2014 08:51:52 -0700 Subject: [PATCH] lib/hmap: Remove the memory fence from hmap_is_empty(). The fence made classifier_lookup() slower. Access to a size_t 'n' is safe without synchonizing, and if racing with writers matters, additional syncronization primitives are used anyway. Signed-off-by: Jarno Rajahalme Signed-off-by: Ben Pfaff --- lib/hmap.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/hmap.h b/lib/hmap.h index 445e74f0b..9fb83d5ab 100644 --- a/lib/hmap.h +++ b/lib/hmap.h @@ -196,7 +196,6 @@ hmap_capacity(const struct hmap *hmap) static inline bool hmap_is_empty(const struct hmap *hmap) { - atomic_thread_fence(memory_order_acquire); return hmap->n == 0; } -- 2.47.0