This commit is contained in:
Behdad Esfahbod 2017-12-14 13:37:48 -08:00
parent f424a34223
commit 9daa88cd79
2 changed files with 13 additions and 4 deletions

View File

@ -184,6 +184,17 @@ struct hb_set_t
hb_prealloced_array_t<page_map_t, 8> page_map;
hb_prealloced_array_t<page_t, 8> pages;
inline void init (void)
{
page_map.init ();
pages.init ();
}
inline void finish (void)
{
page_map.finish ();
pages.finish ();
}
inline bool resize (unsigned int count)
{
if (unlikely (in_error)) return false;

View File

@ -45,8 +45,7 @@ hb_set_create (void)
if (!(set = hb_object_create<hb_set_t> ()))
return hb_set_get_empty ();
set->page_map.init ();
set->pages.init ();
set->init ();
return set;
}
@ -96,8 +95,7 @@ hb_set_destroy (hb_set_t *set)
{
if (!hb_object_destroy (set)) return;
set->page_map.finish ();
set->pages.finish ();
set->finish ();
free (set);
}