[mutex] Add constructor/destructor

Use in one place.
This commit is contained in:
Behdad Esfahbod 2023-01-12 14:52:00 -07:00
parent 8e71f7e8ed
commit 449f6df762
2 changed files with 4 additions and 6 deletions

View File

@ -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); }

View File

@ -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