[object] Call constructor

This commit is contained in:
Behdad Esfahbod 2022-07-20 14:57:32 -06:00
parent 61c0438425
commit 9ea4ab6051
5 changed files with 4 additions and 6 deletions

View File

@ -1675,6 +1675,7 @@ _hb_font_create (hb_face_t *face)
if (unlikely (!face)) if (unlikely (!face))
face = hb_face_get_empty (); face = hb_face_get_empty ();
if (!(font = hb_object_create<hb_font_t> ())) if (!(font = hb_object_create<hb_font_t> ()))
return hb_font_get_empty (); return hb_font_get_empty ();

View File

@ -56,8 +56,6 @@ hb_map_create ()
if (!(map = hb_object_create<hb_map_t> ())) if (!(map = hb_object_create<hb_map_t> ()))
return hb_map_get_empty (); return hb_map_get_empty ();
map->init_shallow ();
return map; return map;
} }

View File

@ -459,8 +459,6 @@ hb_hashmap_t<K, V>* hb_hashmap_create ()
if (!(map = hb_object_create<hashmap> ())) if (!(map = hb_object_create<hashmap> ()))
return nullptr; return nullptr;
map->init_shallow ();
return map; return map;
} }

View File

@ -222,8 +222,11 @@ static inline Type *hb_object_create ()
if (unlikely (!obj)) if (unlikely (!obj))
return obj; return obj;
new (obj) Type;
hb_object_init (obj); hb_object_init (obj);
hb_object_trace (obj, HB_FUNC); hb_object_trace (obj, HB_FUNC);
return obj; return obj;
} }
template <typename Type> template <typename Type>

View File

@ -56,8 +56,6 @@ hb_set_create ()
if (!(set = hb_object_create<hb_set_t> ())) if (!(set = hb_object_create<hb_set_t> ()))
return hb_set_get_empty (); return hb_set_get_empty ();
set->init_shallow ();
return set; return set;
} }