diff --git a/src/hb-bit-set.hh b/src/hb-bit-set.hh index 99d1689ba..a38da130a 100644 --- a/src/hb-bit-set.hh +++ b/src/hb-bit-set.hh @@ -88,9 +88,7 @@ struct hb_bit_set_t bool resize (unsigned int count, bool clear = true) { if (unlikely (!successful)) return false; - pages.alloc (count, true); /* Exact allocation. */ - page_map.alloc (count, true); /* Exact allocation. */ - if (unlikely (!pages.resize (count, clear) || !page_map.resize (count, clear))) + if (unlikely (!pages.resize (count, clear, true) || !page_map.resize (count, clear, true))) { pages.resize (page_map.length); successful = false; @@ -424,8 +422,7 @@ struct hb_bit_set_t private: bool allocate_compact_workspace (hb_vector_t& workspace) { - workspace.alloc (pages.length, true); - if (unlikely (!workspace.resize (pages.length))) + if (unlikely (!workspace.resize_exact (pages.length))) { successful = false; return false; diff --git a/src/hb-cff2-interp-cs.hh b/src/hb-cff2-interp-cs.hh index 346d4c1a7..51f360ee9 100644 --- a/src/hb-cff2-interp-cs.hh +++ b/src/hb-cff2-interp-cs.hh @@ -45,8 +45,7 @@ struct blend_arg_t : number_t numValues = numValues_; valueIndex = valueIndex_; unsigned numBlends = blends_.length; - deltas.alloc (numBlends, true); /* Exact-size allocation. */ - if (unlikely (!deltas.resize (numBlends))) + if (unlikely (!deltas.resize_exact (numBlends))) return; for (unsigned int i = 0; i < numBlends; i++) deltas.arrayZ[i] = blends_.arrayZ[i]; @@ -119,8 +118,7 @@ struct cff2_cs_interp_env_t : cs_interp_env_t region_count = varStore->varStore.get_region_index_count (get_ivs ()); if (do_blend) { - scalars.alloc (region_count, true); - if (unlikely (!scalars.resize (region_count))) + if (unlikely (!scalars.resize_exact (region_count))) SUPER::set_error (); else varStore->varStore.get_region_scalars (get_ivs (), coords, num_coords,