diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-20 10:02:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-20 10:02:53 +0200 |
commit | 2f6abc1002bbb82ba0f4285076e880e20fad4388 (patch) | |
tree | 9eba4712d3e85919dc9dc5756dd6ef172b27a587 /thirdparty/harfbuzz/src/hb-shaper.cc | |
parent | 89417ba75b59f26147218af8d08fced7152a80fa (diff) | |
parent | 3061e3859d603c56b322a6490ebe82db40475d83 (diff) |
Merge pull request #52859 from bruvzg/hb300
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-shaper.cc')
-rw-r--r-- | thirdparty/harfbuzz/src/hb-shaper.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/thirdparty/harfbuzz/src/hb-shaper.cc b/thirdparty/harfbuzz/src/hb-shaper.cc index 0ea68ad1f5..a11ed83afd 100644 --- a/thirdparty/harfbuzz/src/hb-shaper.cc +++ b/thirdparty/harfbuzz/src/hb-shaper.cc @@ -38,9 +38,7 @@ static const hb_shaper_entry_t all_shapers[] = { static_assert (0 != ARRAY_LENGTH_CONST (all_shapers), "No shaper enabled."); #endif -#if HB_USE_ATEXIT -static void free_static_shapers (); -#endif +static inline void free_static_shapers (); static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_t, hb_shapers_lazy_loader_t> @@ -51,7 +49,7 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_ if (!env || !*env) return nullptr; - hb_shaper_entry_t *shapers = (hb_shaper_entry_t *) calloc (1, sizeof (all_shapers)); + hb_shaper_entry_t *shapers = (hb_shaper_entry_t *) hb_calloc (1, sizeof (all_shapers)); if (unlikely (!shapers)) return nullptr; @@ -83,23 +81,19 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_ p = end + 1; } -#if HB_USE_ATEXIT - atexit (free_static_shapers); -#endif + hb_atexit (free_static_shapers); return shapers; } - static void destroy (const hb_shaper_entry_t *p) { free ((void *) p); } + static void destroy (const hb_shaper_entry_t *p) { hb_free ((void *) p); } static const hb_shaper_entry_t *get_null () { return all_shapers; } } static_shapers; -#if HB_USE_ATEXIT -static +static inline void free_static_shapers () { static_shapers.free_instance (); } -#endif const hb_shaper_entry_t * _hb_shapers_get () |