diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 7eb706af638036cb425e65d6e0f41dded209cb23..0c313a7c50cb98ac3f1891fe91c47d383653da0f 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -294,7 +294,7 @@ struct CmapSubtableLongSegmented } inline bool serialize (hb_serialize_context_t *c, - hb_prealloced_array_t &group_data) + hb_vector_t &group_data) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); @@ -548,7 +548,7 @@ struct cmap } inline bool populate_groups (hb_subset_plan_t *plan, - hb_prealloced_array_t *groups) const + hb_vector_t *groups) const { CmapSubtableLongGroup *group = nullptr; for (unsigned int i = 0; i < plan->codepoints.len; i++) { @@ -582,7 +582,7 @@ struct cmap return true; } - inline bool _subset (hb_prealloced_array_t &groups, + inline bool _subset (hb_vector_t &groups, size_t dest_sz, void *dest) const { diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index b209a4ecc9c8e950b392b8a5fbcbf8a2be8942ef..5944688aab2aa46dd8e3de0a40be1f0343392408 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -94,7 +94,7 @@ struct hmtxvmtx /* All the trailing glyphs with the same advance can use one LongMetric * and just keep LSB */ - hb_prealloced_array_t &gids = plan->gids_to_retain_sorted; + hb_vector_t &gids = plan->gids_to_retain_sorted; unsigned int num_advances = gids.len; unsigned int last_advance = _mtx.get_advance (gids[num_advances - 1]); while (num_advances > 1 diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh index 9cfe366809121143fce48fe2542d919c64363e90..f34c2bfc13f345c05f93a610141b63034004f8f8 100644 --- a/src/hb-ot-map-private.hh +++ b/src/hb-ot-map-private.hh @@ -147,9 +147,9 @@ struct hb_ot_map_t hb_mask_t global_mask; - hb_prealloced_array_t features; - hb_prealloced_array_t lookups[2]; /* GSUB/GPOS */ - hb_prealloced_array_t stages[2]; /* GSUB/GPOS */ + hb_vector_t features; + hb_vector_t lookups[2]; /* GSUB/GPOS */ + hb_vector_t stages[2]; /* GSUB/GPOS */ }; enum hb_ot_map_feature_flags_t { @@ -241,8 +241,8 @@ struct hb_ot_map_builder_t private: unsigned int current_stage[2]; /* GSUB/GPOS */ - hb_prealloced_array_t feature_infos; - hb_prealloced_array_t stages[2]; /* GSUB/GPOS */ + hb_vector_t feature_infos; + hb_vector_t stages[2]; /* GSUB/GPOS */ }; diff --git a/src/hb-ot-os2-table.hh b/src/hb-ot-os2-table.hh index dfb87dc0a21069037bd9cd93a1e0d749230f3942..7d26a207034ee33a80ae206346d8a84aaf65efef 100644 --- a/src/hb-ot-os2-table.hh +++ b/src/hb-ot-os2-table.hh @@ -74,7 +74,7 @@ struct os2 return result; } - inline void _update_unicode_ranges (const hb_prealloced_array_t &codepoints, + inline void _update_unicode_ranges (const hb_vector_t &codepoints, HBUINT32 ulUnicodeRange[4]) const { for (unsigned int i = 0; i < 4; i++) @@ -101,7 +101,7 @@ struct os2 } } - static inline void find_min_and_max_codepoint (const hb_prealloced_array_t &codepoints, + static inline void find_min_and_max_codepoint (const hb_vector_t &codepoints, uint16_t *min_cp, /* OUT */ uint16_t *max_cp /* OUT */) { diff --git a/src/hb-ot-post-table.hh b/src/hb-ot-post-table.hh index f3605242378711ed62d63b15f6d03185eff368f3..0cd97fa203b819c5bcc45da281468cc7cc9349ae 100644 --- a/src/hb-ot-post-table.hh +++ b/src/hb-ot-post-table.hh @@ -258,7 +258,7 @@ struct post hb_blob_t *blob; uint32_t version; const ArrayOf *glyphNameIndex; - hb_prealloced_array_t index_to_offset; + hb_vector_t index_to_offset; const uint8_t *pool; mutable uint16_t *gids_sorted_by_name; }; diff --git a/src/hb-private.hh b/src/hb-private.hh index a9a6bda4b59bebb4ee4380bf5fb82f04aaad2d4e..d7c8fef8d5fb51b9361cf7c3c5430406c7adb2c7 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -527,7 +527,7 @@ _hb_ceil_to_4 (unsigned int v) #define HB_PREALLOCED_ARRAY_INIT {0, 0, nullptr} template -struct hb_prealloced_array_t +struct hb_vector_t { unsigned int len; unsigned int allocated; @@ -710,14 +710,14 @@ struct hb_auto_t : Type void fini (void) {} }; template -struct hb_auto_array_t : hb_auto_t > {}; +struct hb_auto_array_t : hb_auto_t > {}; #define HB_LOCKABLE_SET_INIT {HB_PREALLOCED_ARRAY_INIT} template struct hb_lockable_set_t { - hb_prealloced_array_t items; + hb_vector_t items; inline void init (void) { items.init (); } diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh index df3326b34d8b4b51ef6c590d0f5f4de45067a6ed..4288b15b366f7e0c5e84381f6153d0348f980f9a 100644 --- a/src/hb-set-private.hh +++ b/src/hb-set-private.hh @@ -190,8 +190,8 @@ struct hb_set_t ASSERT_POD (); bool in_error; mutable unsigned int population; - hb_prealloced_array_t page_map; - hb_prealloced_array_t pages; + hb_vector_t page_map; + hb_vector_t pages; inline void init (void) { diff --git a/src/hb-subset-glyf.cc b/src/hb-subset-glyf.cc index 372832f1418548b44177ce4d28d383abbb67dc23..2daa63ed99abf8b095c860c0e6dbdf7a3063784b 100644 --- a/src/hb-subset-glyf.cc +++ b/src/hb-subset-glyf.cc @@ -32,12 +32,12 @@ static bool _calculate_glyf_and_loca_prime_size (const OT::glyf::accelerator_t &glyf, - hb_prealloced_array_t &glyph_ids, + hb_vector_t &glyph_ids, hb_bool_t drop_hints, bool *use_short_loca /* OUT */, unsigned int *glyf_size /* OUT */, unsigned int *loca_size /* OUT */, - hb_prealloced_array_t *instruction_ranges /* OUT */) + hb_vector_t *instruction_ranges /* OUT */) { unsigned int total = 0; for (unsigned int i = 0; i < glyph_ids.len; i++) @@ -159,13 +159,13 @@ _write_glyf_and_loca_prime (hb_subset_plan_t *plan, const OT::glyf::accelerator_t &glyf, const char *glyf_data, bool use_short_loca, - hb_prealloced_array_t &instruction_ranges, + hb_vector_t &instruction_ranges, unsigned int glyf_prime_size, char *glyf_prime_data /* OUT */, unsigned int loca_prime_size, char *loca_prime_data /* OUT */) { - hb_prealloced_array_t &glyph_ids = plan->gids_to_retain_sorted; + hb_vector_t &glyph_ids = plan->gids_to_retain_sorted; char *glyf_prime_data_next = glyf_prime_data; bool success = true; @@ -234,11 +234,11 @@ _hb_subset_glyf_and_loca (const OT::glyf::accelerator_t &glyf, hb_blob_t **loca_prime /* OUT */) { // TODO(grieger): Sanity check allocation size for the new table. - hb_prealloced_array_t &glyphs_to_retain = plan->gids_to_retain_sorted; + hb_vector_t &glyphs_to_retain = plan->gids_to_retain_sorted; unsigned int glyf_prime_size; unsigned int loca_prime_size; - hb_prealloced_array_t instruction_ranges; + hb_vector_t instruction_ranges; instruction_ranges.init(); if (unlikely (!_calculate_glyf_and_loca_prime_size (glyf, diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 1784aefbd2c420893d35bbb9ceee6664f48fe529..c28e6085f09da16717abbd8f0f5255966eec90ff 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -87,7 +87,7 @@ hb_subset_plan_add_table (hb_subset_plan_t *plan, static void _populate_codepoints (hb_set_t *input_codepoints, - hb_prealloced_array_t& plan_codepoints) + hb_vector_t& plan_codepoints) { plan_codepoints.alloc (hb_set_get_population (input_codepoints)); hb_codepoint_t cp = -1; @@ -121,9 +121,9 @@ _add_gid_and_children (const OT::glyf::accelerator_t &glyf, static void _populate_gids_to_retain (hb_face_t *face, - hb_prealloced_array_t& codepoints, - hb_prealloced_array_t& old_gids, - hb_prealloced_array_t& old_gids_sorted) + hb_vector_t& codepoints, + hb_vector_t& old_gids, + hb_vector_t& old_gids_sorted) { OT::cmap::accelerator_t cmap; OT::glyf::accelerator_t glyf; diff --git a/src/hb-subset-plan.hh b/src/hb-subset-plan.hh index d1b66b44d5423e3ac21ce5e16e2ae858bf905408..3b9db03f2714ac7efc357a580345fbdbfeeba640 100644 --- a/src/hb-subset-plan.hh +++ b/src/hb-subset-plan.hh @@ -45,12 +45,12 @@ struct hb_subset_plan_t { // These first two lists provide a mapping from cp -> gid // As a result it does not list the full set of glyphs to retain. - hb_prealloced_array_t codepoints; - hb_prealloced_array_t gids_to_retain; + hb_vector_t codepoints; + hb_vector_t gids_to_retain; // This list contains the complete set of glyphs to retain and may contain // more glyphs then the lists above. - hb_prealloced_array_t gids_to_retain_sorted; + hb_vector_t gids_to_retain_sorted; // Plan is only good for a specific source/dest so keep them with it hb_face_t *source; diff --git a/src/hb-subset.cc b/src/hb-subset.cc index 41f4453376ac5d5d704bd351926854afd2fee768..35fe0ef84127ce128934c66178063608b64eff10 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -123,7 +123,7 @@ struct hb_subset_face_data_t hb_blob_t *blob; }; - hb_prealloced_array_t tables; + hb_vector_t tables; }; static hb_subset_face_data_t *