[vector] A couple more exact-size allocations

This commit is contained in:
Behdad Esfahbod 2022-12-31 12:35:30 -07:00
parent 2eacc37e08
commit 92e5933ee6
1 changed files with 2 additions and 2 deletions

View File

@ -425,7 +425,7 @@ struct name
hb_vector_t<hb_ot_name_record_ids_t> insert_name_records;
if (!name_table_overrides->is_empty ())
{
if (unlikely (!insert_name_records.alloc (name_table_overrides->get_population ())))
if (unlikely (!insert_name_records.alloc (name_table_overrides->get_population (), true)))
return_trace (false);
for (const auto& record_ids : name_table_overrides->keys ())
{
@ -475,7 +475,7 @@ struct name
const hb_array_t<const NameRecord> all_names (this->table->nameRecordZ.arrayZ,
this->table->count);
this->names.alloc (all_names.length);
this->names.alloc (all_names.length, true);
for (unsigned int i = 0; i < all_names.length; i++)
{