From c56ce8681c209abd147328142806769752091b1c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 28 May 2022 04:25:51 -0600 Subject: [PATCH] Revert "[ot-lang] Use atomic int for cache" This reverts commit d61b2074915cf5f8044dcb8e3dafc04b5b58c6b8. --- src/hb-ot-tag.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-tag.cc b/src/hb-ot-tag.cc index 31ce1a1e2..a4a951536 100644 --- a/src/hb-ot-tag.cc +++ b/src/hb-ot-tag.cc @@ -297,13 +297,13 @@ hb_ot_tags_from_language (const char *lang_str, hb_tag_t lang_tag = hb_tag_from_string (lang_str, first_len); - static hb_atomic_int_t last_tag_idx; /* Poor man's cache. */ - unsigned tag_idx = last_tag_idx.get_relaxed (); + static unsigned last_tag_idx; /* Poor man's cache. */ + unsigned tag_idx = last_tag_idx; if (likely (tag_idx < ot_languages_len && ot_languages[tag_idx].language == lang_tag) || hb_sorted_array (ot_languages, ot_languages_len).bfind (lang_tag, &tag_idx)) { - last_tag_idx.set_relaxed (tag_idx); + last_tag_idx = tag_idx; unsigned int i; while (tag_idx != 0 && ot_languages[tag_idx].language == ot_languages[tag_idx - 1].language)