[config] Add HB_NO_GDEF_CACHE
diff --git a/src/OT/Layout/GDEF/GDEF.hh b/src/OT/Layout/GDEF/GDEF.hh index 95d7a71..c1ff796 100644 --- a/src/OT/Layout/GDEF/GDEF.hh +++ b/src/OT/Layout/GDEF/GDEF.hh
@@ -865,18 +865,27 @@ unsigned int get_glyph_props (hb_codepoint_t glyph) const { unsigned v; + +#ifndef HB_NO_GDEF_CACHE if (glyph_props_cache.get (glyph, &v)) return v; +#endif v = table->get_glyph_props (glyph); + +#ifndef HB_NO_GDEF_CACHE if (likely (table.get_blob ())) // Don't try setting if we are the null instance! glyph_props_cache.set (glyph, v); +#endif return v; + } hb_blob_ptr_t<GDEF> table; +#ifndef HB_NO_GDEF_CACHE mutable hb_cache_t<21, 3, 8> glyph_props_cache; +#endif }; void collect_variation_indices (hb_collect_variation_indices_context_t *c) const
diff --git a/src/hb-config.hh b/src/hb-config.hh index 22587f6..1ed39bb 100644 --- a/src/hb-config.hh +++ b/src/hb-config.hh
@@ -189,6 +189,7 @@ #ifdef HB_OPTIMIZE_SIZE #define HB_NO_OT_LAYOUT_LOOKUP_CACHE +#define HB_NO_GDEF_CACHE #endif