[mutex] Add constructor/destructor

Use in one place.
pull/4033/head
Behdad Esfahbod 2 years ago
parent 8e71f7e8ed
commit 449f6df762
  1. 3
      src/hb-mutex.hh
  2. 7
      src/hb-subset-accelerator.hh

@ -97,6 +97,9 @@ struct hb_mutex_t
/* Create space for, but do not initialize m. */
alignas(hb_mutex_impl_t) char m[sizeof (hb_mutex_impl_t)];
hb_mutex_t () { init (); }
~hb_mutex_t () { fini (); }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
void init () { hb_mutex_impl_init ((hb_mutex_impl_t *) m); }

@ -88,10 +88,7 @@ struct hb_subset_accelerator_t
destroy_cmap_cache(nullptr),
has_seac(has_seac_),
cff_accelerator(nullptr),
destroy_cff_accelerator(nullptr)
{
sanitized_table_cache_lock.init ();
}
destroy_cff_accelerator(nullptr) {}
~hb_subset_accelerator_t ()
{
@ -100,8 +97,6 @@ struct hb_subset_accelerator_t
if (cmap_cache && destroy_cmap_cache)
destroy_cmap_cache ((void*) cmap_cache);
sanitized_table_cache_lock.fini ();
}
// Generic

Loading…
Cancel
Save