From e4b6d503c5575ddbf49249e3fef693d75ae75170 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 27 May 2012 10:11:13 -0400 Subject: [PATCH] Don't use atomic ops in hb_cache_t We don't care about linearizability, so unprotected int read/write are enough, no need for expensive memory barriers. It's a cache, that's all. --- src/hb-cache-private.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-cache-private.hh b/src/hb-cache-private.hh index 7394fbb..a0928a0 100644 --- a/src/hb-cache-private.hh +++ b/src/hb-cache-private.hh @@ -36,7 +36,7 @@ template = cache_bits); - ASSERT_STATIC (key_bits + value_bits - cache_bits < 8 * sizeof (hb_atomic_int_t)); + ASSERT_STATIC (key_bits + value_bits - cache_bits < 8 * sizeof (unsigned int)); inline void clear (void) { @@ -46,7 +46,7 @@ struct hb_cache_t inline bool get (unsigned int key, unsigned int *value) { unsigned int k = key & ((1<> value_bits) != (key >> cache_bits)) return false; } @@ -57,12 +57,12 @@ struct hb_cache_t return false; /* Overflows */ unsigned int k = key & ((1<>cache_bits)< hb_cmap_cache_t; -- 2.7.4