/src/harfbuzz/src/hb-vector.hh
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright © 2017,2018 Google, Inc. |
3 | | * |
4 | | * This is part of HarfBuzz, a text shaping library. |
5 | | * |
6 | | * Permission is hereby granted, without written agreement and without |
7 | | * license or royalty fees, to use, copy, modify, and distribute this |
8 | | * software and its documentation for any purpose, provided that the |
9 | | * above copyright notice and the following two paragraphs appear in |
10 | | * all copies of this software. |
11 | | * |
12 | | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
13 | | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
14 | | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
15 | | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
16 | | * DAMAGE. |
17 | | * |
18 | | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
19 | | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
20 | | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
21 | | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
22 | | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
23 | | * |
24 | | * Google Author(s): Behdad Esfahbod |
25 | | */ |
26 | | |
27 | | #ifndef HB_VECTOR_HH |
28 | | #define HB_VECTOR_HH |
29 | | |
30 | | #include "hb.hh" |
31 | | #include "hb-array.hh" |
32 | | #include "hb-meta.hh" |
33 | | #include "hb-null.hh" |
34 | | |
35 | | |
36 | | template <typename Type, |
37 | | bool sorted=false> |
38 | | struct hb_vector_t |
39 | | { |
40 | | typedef Type item_t; |
41 | | static constexpr unsigned item_size = hb_static_size (Type); |
42 | | using array_t = typename std::conditional<sorted, hb_sorted_array_t<Type>, hb_array_t<Type>>::type; |
43 | | using c_array_t = typename std::conditional<sorted, hb_sorted_array_t<const Type>, hb_array_t<const Type>>::type; |
44 | | |
45 | 9.14M | hb_vector_t () = default; hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::hb_vector_t() Line | Count | Source | 45 | 148k | hb_vector_t () = default; |
hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::hb_vector_t() Line | Count | Source | 45 | 296k | hb_vector_t () = default; |
hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::hb_vector_t() Line | Count | Source | 45 | 148k | hb_vector_t () = default; |
hb_vector_t<hb_aat_map_t::range_flags_t, true>::hb_vector_t() Line | Count | Source | 45 | 164k | hb_vector_t () = default; |
hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::hb_vector_t() Line | Count | Source | 45 | 148k | hb_vector_t () = default; |
hb_vector_t<unsigned int, false>::hb_vector_t() Line | Count | Source | 45 | 395k | hb_vector_t () = default; |
hb_vector_t<hb_bit_set_t::page_map_t, true>::hb_vector_t() Line | Count | Source | 45 | 596k | hb_vector_t () = default; |
hb_vector_t<hb_bit_page_t, false>::hb_vector_t() Line | Count | Source | 45 | 596k | hb_vector_t () = default; |
hb_vector_t<int, false>::hb_vector_t() Line | Count | Source | 45 | 130k | hb_vector_t () = default; |
hb_vector_t<OT::contour_point_t, false>::hb_vector_t() Line | Count | Source | 45 | 616k | hb_vector_t () = default; |
hb_vector_t<CFF::cff1_top_dict_val_t, false>::hb_vector_t() Line | Count | Source | 45 | 195k | hb_vector_t () = default; |
hb_vector_t<CFF::cff1_font_dict_values_t, false>::hb_vector_t() Line | Count | Source | 45 | 195k | hb_vector_t () = default; |
hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::hb_vector_t() Line | Count | Source | 45 | 195k | hb_vector_t () = default; |
hb_vector_t<CFF::dict_val_t, false>::hb_vector_t() Line | Count | Source | 45 | 942k | hb_vector_t () = default; |
hb_vector_t<CFF::op_str_t, false>::hb_vector_t() Line | Count | Source | 45 | 1.38M | hb_vector_t () = default; |
hb_vector_t<CFF::cff2_font_dict_values_t, false>::hb_vector_t() Line | Count | Source | 45 | 160k | hb_vector_t () = default; |
hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::hb_vector_t() Line | Count | Source | 45 | 160k | hb_vector_t () = default; |
hb_vector_t<hb_transform_t, false>::hb_vector_t() Line | Count | Source | 45 | 19.3k | hb_vector_t () = default; |
hb_vector_t<hb_bounds_t, false>::hb_vector_t() Line | Count | Source | 45 | 38.7k | hb_vector_t () = default; |
Unexecuted instantiation: hb_vector_t<hb_set_t, false>::hb_vector_t() hb_vector_t<hb_ot_name_entry_t, false>::hb_vector_t() Line | Count | Source | 45 | 197k | hb_vector_t () = default; |
hb_vector_t<hb_ot_map_t::feature_map_t, true>::hb_vector_t() Line | Count | Source | 45 | 297k | hb_vector_t () = default; |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::hb_vector_t() Line | Count | Source | 45 | 594k | hb_vector_t () = default; |
hb_vector_t<hb_ot_map_t::stage_map_t, false>::hb_vector_t() Line | Count | Source | 45 | 594k | hb_vector_t () = default; |
hb_vector_t<char, false>::hb_vector_t() Line | Count | Source | 45 | 2.83k | hb_vector_t () = default; |
hb_vector_t<float, false>::hb_vector_t() Line | Count | Source | 45 | 20.8k | hb_vector_t () = default; |
hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::hb_vector_t() Line | Count | Source | 45 | 294k | hb_vector_t () = default; |
hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::hb_vector_t() Line | Count | Source | 45 | 588k | hb_vector_t () = default; |
hb_vector_t<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, false>::hb_vector_t() Line | Count | Source | 45 | 10.3k | hb_vector_t () = default; |
hb_vector_t<hb_serialize_context_t::object_t*, false>::hb_vector_t() Line | Count | Source | 45 | 10.3k | hb_vector_t () = default; |
|
46 | | hb_vector_t (std::initializer_list<Type> lst) : hb_vector_t () |
47 | | { |
48 | | alloc (lst.size (), true); |
49 | | for (auto&& item : lst) |
50 | | push (item); |
51 | | } |
52 | | template <typename Iterable, |
53 | | hb_requires (hb_is_iterable (Iterable))> |
54 | | hb_vector_t (const Iterable &o) : hb_vector_t () |
55 | 42.9k | { |
56 | 42.9k | auto iter = hb_iter (o); |
57 | 42.9k | if (iter.is_random_access_iterator) |
58 | 42.9k | alloc (hb_len (iter), true); |
59 | 42.9k | hb_copy (iter, *this); |
60 | 42.9k | } |
61 | | hb_vector_t (const hb_vector_t &o) : hb_vector_t () |
62 | | { |
63 | | alloc (o.length, true); |
64 | | if (unlikely (in_error ())) return; |
65 | | copy_vector (o); |
66 | | } |
67 | | hb_vector_t (hb_vector_t &&o) |
68 | | { |
69 | | allocated = o.allocated; |
70 | | length = o.length; |
71 | | arrayZ = o.arrayZ; |
72 | | o.init (); |
73 | | } |
74 | 9.13M | ~hb_vector_t () { fini (); } hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::~hb_vector_t() Line | Count | Source | 74 | 148k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_aat_map_t::range_flags_t, true>::~hb_vector_t() Line | Count | Source | 74 | 164k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::~hb_vector_t() Line | Count | Source | 74 | 296k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::~hb_vector_t() Line | Count | Source | 74 | 148k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::~hb_vector_t() Line | Count | Source | 74 | 148k | ~hb_vector_t () { fini (); } |
hb_vector_t<unsigned int, false>::~hb_vector_t() Line | Count | Source | 74 | 395k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_bit_page_t, false>::~hb_vector_t() Line | Count | Source | 74 | 596k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_bit_set_t::page_map_t, true>::~hb_vector_t() Line | Count | Source | 74 | 596k | ~hb_vector_t () { fini (); } |
hb_vector_t<int, false>::~hb_vector_t() Line | Count | Source | 74 | 130k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_ot_name_entry_t, false>::~hb_vector_t() Line | Count | Source | 74 | 197k | ~hb_vector_t () { fini (); } |
hb_vector_t<CFF::op_str_t, false>::~hb_vector_t() Line | Count | Source | 74 | 1.38M | ~hb_vector_t () { fini (); } |
hb_vector_t<CFF::dict_val_t, false>::~hb_vector_t() Line | Count | Source | 74 | 942k | ~hb_vector_t () { fini (); } |
hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::~hb_vector_t() Line | Count | Source | 74 | 195k | ~hb_vector_t () { fini (); } |
hb_vector_t<CFF::cff1_font_dict_values_t, false>::~hb_vector_t() Line | Count | Source | 74 | 195k | ~hb_vector_t () { fini (); } |
hb_vector_t<CFF::cff1_top_dict_val_t, false>::~hb_vector_t() Line | Count | Source | 74 | 195k | ~hb_vector_t () { fini (); } |
hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::~hb_vector_t() Line | Count | Source | 74 | 160k | ~hb_vector_t () { fini (); } |
hb_vector_t<CFF::cff2_font_dict_values_t, false>::~hb_vector_t() Line | Count | Source | 74 | 160k | ~hb_vector_t () { fini (); } |
hb_vector_t<OT::contour_point_t, false>::~hb_vector_t() Line | Count | Source | 74 | 616k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_bounds_t, false>::~hb_vector_t() Line | Count | Source | 74 | 38.7k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_transform_t, false>::~hb_vector_t() Line | Count | Source | 74 | 19.3k | ~hb_vector_t () { fini (); } |
Unexecuted instantiation: hb_vector_t<hb_set_t, false>::~hb_vector_t() hb_vector_t<hb_ot_map_t::stage_map_t, false>::~hb_vector_t() Line | Count | Source | 74 | 588k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::~hb_vector_t() Line | Count | Source | 74 | 588k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_ot_map_t::feature_map_t, true>::~hb_vector_t() Line | Count | Source | 74 | 294k | ~hb_vector_t () { fini (); } |
hb_vector_t<char, false>::~hb_vector_t() Line | Count | Source | 74 | 2.83k | ~hb_vector_t () { fini (); } |
hb_vector_t<float, false>::~hb_vector_t() Line | Count | Source | 74 | 20.8k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::~hb_vector_t() Line | Count | Source | 74 | 588k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::~hb_vector_t() Line | Count | Source | 74 | 294k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_serialize_context_t::object_t*, false>::~hb_vector_t() Line | Count | Source | 74 | 10.3k | ~hb_vector_t () { fini (); } |
hb_vector_t<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, false>::~hb_vector_t() Line | Count | Source | 74 | 10.3k | ~hb_vector_t () { fini (); } |
|
75 | | |
76 | | public: |
77 | | int allocated = 0; /* == -1 means allocation failed. */ |
78 | | unsigned int length = 0; |
79 | | public: |
80 | | Type *arrayZ = nullptr; |
81 | | |
82 | | void init () |
83 | 23.9M | { |
84 | 23.9M | allocated = length = 0; |
85 | 23.9M | arrayZ = nullptr; |
86 | 23.9M | } hb_vector_t<hb_aat_map_t::range_flags_t, true>::init() Line | Count | Source | 83 | 164k | { | 84 | 164k | allocated = length = 0; | 85 | 164k | arrayZ = nullptr; | 86 | 164k | } |
hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::init() Line | Count | Source | 83 | 148k | { | 84 | 148k | allocated = length = 0; | 85 | 148k | arrayZ = nullptr; | 86 | 148k | } |
hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::init() Line | Count | Source | 83 | 296k | { | 84 | 296k | allocated = length = 0; | 85 | 296k | arrayZ = nullptr; | 86 | 296k | } |
hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::init() Line | Count | Source | 83 | 148k | { | 84 | 148k | allocated = length = 0; | 85 | 148k | arrayZ = nullptr; | 86 | 148k | } |
hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::init() Line | Count | Source | 83 | 396k | { | 84 | 396k | allocated = length = 0; | 85 | 396k | arrayZ = nullptr; | 86 | 396k | } |
hb_vector_t<hb_ot_map_t::feature_map_t, true>::init() Line | Count | Source | 83 | 588k | { | 84 | 588k | allocated = length = 0; | 85 | 588k | arrayZ = nullptr; | 86 | 588k | } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::init() Line | Count | Source | 83 | 1.17M | { | 84 | 1.17M | allocated = length = 0; | 85 | 1.17M | arrayZ = nullptr; | 86 | 1.17M | } |
hb_vector_t<hb_ot_map_t::stage_map_t, false>::init() Line | Count | Source | 83 | 1.17M | { | 84 | 1.17M | allocated = length = 0; | 85 | 1.17M | arrayZ = nullptr; | 86 | 1.17M | } |
hb_vector_t<hb_bit_set_t::page_map_t, true>::init() Line | Count | Source | 83 | 1.79M | { | 84 | 1.79M | allocated = length = 0; | 85 | 1.79M | arrayZ = nullptr; | 86 | 1.79M | } |
hb_vector_t<hb_bit_page_t, false>::init() Line | Count | Source | 83 | 1.79M | { | 84 | 1.79M | allocated = length = 0; | 85 | 1.79M | arrayZ = nullptr; | 86 | 1.79M | } |
hb_vector_t<unsigned int, false>::init() Line | Count | Source | 83 | 395k | { | 84 | 395k | allocated = length = 0; | 85 | 395k | arrayZ = nullptr; | 86 | 395k | } |
hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::init() Line | Count | Source | 83 | 302k | { | 84 | 302k | allocated = length = 0; | 85 | 302k | arrayZ = nullptr; | 86 | 302k | } |
hb_vector_t<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, false>::init() Line | Count | Source | 83 | 10.3k | { | 84 | 10.3k | allocated = length = 0; | 85 | 10.3k | arrayZ = nullptr; | 86 | 10.3k | } |
hb_vector_t<hb_serialize_context_t::object_t*, false>::init() Line | Count | Source | 83 | 30.9k | { | 84 | 30.9k | allocated = length = 0; | 85 | 30.9k | arrayZ = nullptr; | 86 | 30.9k | } |
Unexecuted instantiation: hb_vector_t<hb_vector_t<unsigned int, false>, false>::init() Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, true>::init() Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::init() hb_vector_t<int, false>::init() Line | Count | Source | 83 | 130k | { | 84 | 130k | allocated = length = 0; | 85 | 130k | arrayZ = nullptr; | 86 | 130k | } |
Unexecuted instantiation: hb_vector_t<unsigned int, true>::init() Unexecuted instantiation: hb_vector_t<OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t, false>::init() Unexecuted instantiation: hb_vector_t<hb_set_t, false>::init() hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::init() Line | Count | Source | 83 | 3.10M | { | 84 | 3.10M | allocated = length = 0; | 85 | 3.10M | arrayZ = nullptr; | 86 | 3.10M | } |
hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::init() Line | Count | Source | 83 | 148k | { | 84 | 148k | allocated = length = 0; | 85 | 148k | arrayZ = nullptr; | 86 | 148k | } |
Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::init() hb_vector_t<hb_transform_t, false>::init() Line | Count | Source | 83 | 19.3k | { | 84 | 19.3k | allocated = length = 0; | 85 | 19.3k | arrayZ = nullptr; | 86 | 19.3k | } |
hb_vector_t<hb_bounds_t, false>::init() Line | Count | Source | 83 | 38.7k | { | 84 | 38.7k | allocated = length = 0; | 85 | 38.7k | arrayZ = nullptr; | 86 | 38.7k | } |
Unexecuted instantiation: hb_vector_t<OT::LayerRecord, false>::init() Unexecuted instantiation: hb_vector_t<hb_set_t*, false>::init() Unexecuted instantiation: hb_vector_t<OT::index_map_subset_plan_t, false>::init() Unexecuted instantiation: hb_vector_t<OT::DeltaSetIndexMap const*, false>::init() hb_vector_t<OT::contour_point_t, false>::init() Line | Count | Source | 83 | 616k | { | 84 | 616k | allocated = length = 0; | 85 | 616k | arrayZ = nullptr; | 86 | 616k | } |
Unexecuted instantiation: hb_vector_t<unsigned char, false>::init() Unexecuted instantiation: hb_vector_t<OT::glyf_impl::SubsetGlyph, false>::init() Unexecuted instantiation: hb_vector_t<hb_variation_t, false>::init() Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, false>::init() Unexecuted instantiation: hb_vector_t<OT::IndexSubtableRecord, false>::init() hb_vector_t<char, false>::init() Line | Count | Source | 83 | 2.83k | { | 84 | 2.83k | allocated = length = 0; | 85 | 2.83k | arrayZ = nullptr; | 86 | 2.83k | } |
Unexecuted instantiation: hb_vector_t<OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*, false>::init() hb_vector_t<hb_ot_name_entry_t, false>::init() Line | Count | Source | 83 | 197k | { | 84 | 197k | allocated = length = 0; | 85 | 197k | arrayZ = nullptr; | 86 | 197k | } |
hb_vector_t<OT::cff1::accelerator_t::gname_t, true>::init() Line | Count | Source | 83 | 37.2k | { | 84 | 37.2k | allocated = length = 0; | 85 | 37.2k | arrayZ = nullptr; | 86 | 37.2k | } |
hb_vector_t<CFF::cff1_top_dict_val_t, false>::init() Line | Count | Source | 83 | 792k | { | 84 | 792k | allocated = length = 0; | 85 | 792k | arrayZ = nullptr; | 86 | 792k | } |
hb_vector_t<CFF::op_str_t, false>::init() Line | Count | Source | 83 | 2.64M | { | 84 | 2.64M | allocated = length = 0; | 85 | 2.64M | arrayZ = nullptr; | 86 | 2.64M | } |
hb_vector_t<CFF::cff1_font_dict_values_t, false>::init() Line | Count | Source | 83 | 759k | { | 84 | 759k | allocated = length = 0; | 85 | 759k | arrayZ = nullptr; | 86 | 759k | } |
hb_vector_t<CFF::dict_val_t, false>::init() Line | Count | Source | 83 | 2.29M | { | 84 | 2.29M | allocated = length = 0; | 85 | 2.29M | arrayZ = nullptr; | 86 | 2.29M | } |
hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::init() Line | Count | Source | 83 | 759k | { | 84 | 759k | allocated = length = 0; | 85 | 759k | arrayZ = nullptr; | 86 | 759k | } |
hb_vector_t<CFF::cff2_font_dict_values_t, false>::init() Line | Count | Source | 83 | 629k | { | 84 | 629k | allocated = length = 0; | 85 | 629k | arrayZ = nullptr; | 86 | 629k | } |
hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::init() Line | Count | Source | 83 | 629k | { | 84 | 629k | allocated = length = 0; | 85 | 629k | arrayZ = nullptr; | 86 | 629k | } |
Unexecuted instantiation: hb_vector_t<hb_array_t<unsigned char const>, false>::init() Unexecuted instantiation: hb_vector_t<hb_ot_name_record_ids_t, false>::init() hb_vector_t<float, false>::init() Line | Count | Source | 83 | 41.6k | { | 84 | 41.6k | allocated = length = 0; | 85 | 41.6k | arrayZ = nullptr; | 86 | 41.6k | } |
hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::init() Line | Count | Source | 83 | 883k | { | 84 | 883k | allocated = length = 0; | 85 | 883k | arrayZ = nullptr; | 86 | 883k | } |
hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::init() Line | Count | Source | 83 | 1.76M | { | 84 | 1.76M | allocated = length = 0; | 85 | 1.76M | arrayZ = nullptr; | 86 | 1.76M | } |
|
87 | | void init0 () |
88 | 1.47M | { |
89 | 1.47M | } hb_vector_t<hb_ot_map_t::feature_map_t, true>::init0() Line | Count | Source | 88 | 294k | { | 89 | 294k | } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::init0() Line | Count | Source | 88 | 588k | { | 89 | 588k | } |
hb_vector_t<hb_ot_map_t::stage_map_t, false>::init0() Line | Count | Source | 88 | 588k | { | 89 | 588k | } |
|
90 | | |
91 | | void fini () |
92 | 16.8M | { |
93 | 16.8M | shrink_vector (0); |
94 | 16.8M | hb_free (arrayZ); |
95 | 16.8M | init (); |
96 | 16.8M | } hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::fini() Line | Count | Source | 92 | 148k | { | 93 | 148k | shrink_vector (0); | 94 | 148k | hb_free (arrayZ); | 95 | 148k | init (); | 96 | 148k | } |
hb_vector_t<hb_aat_map_t::range_flags_t, true>::fini() Line | Count | Source | 92 | 164k | { | 93 | 164k | shrink_vector (0); | 94 | 164k | hb_free (arrayZ); | 95 | 164k | init (); | 96 | 164k | } |
hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::fini() Line | Count | Source | 92 | 296k | { | 93 | 296k | shrink_vector (0); | 94 | 296k | hb_free (arrayZ); | 95 | 296k | init (); | 96 | 296k | } |
hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::fini() Line | Count | Source | 92 | 148k | { | 93 | 148k | shrink_vector (0); | 94 | 148k | hb_free (arrayZ); | 95 | 148k | init (); | 96 | 148k | } |
hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::fini() Line | Count | Source | 92 | 198k | { | 93 | 198k | shrink_vector (0); | 94 | 198k | hb_free (arrayZ); | 95 | 198k | init (); | 96 | 198k | } |
hb_vector_t<hb_ot_map_t::feature_map_t, true>::fini() Line | Count | Source | 92 | 588k | { | 93 | 588k | shrink_vector (0); | 94 | 588k | hb_free (arrayZ); | 95 | 588k | init (); | 96 | 588k | } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::fini() Line | Count | Source | 92 | 1.17M | { | 93 | 1.17M | shrink_vector (0); | 94 | 1.17M | hb_free (arrayZ); | 95 | 1.17M | init (); | 96 | 1.17M | } |
hb_vector_t<hb_ot_map_t::stage_map_t, false>::fini() Line | Count | Source | 92 | 1.17M | { | 93 | 1.17M | shrink_vector (0); | 94 | 1.17M | hb_free (arrayZ); | 95 | 1.17M | init (); | 96 | 1.17M | } |
hb_vector_t<hb_bit_set_t::page_map_t, true>::fini() Line | Count | Source | 92 | 1.19M | { | 93 | 1.19M | shrink_vector (0); | 94 | 1.19M | hb_free (arrayZ); | 95 | 1.19M | init (); | 96 | 1.19M | } |
hb_vector_t<hb_bit_page_t, false>::fini() Line | Count | Source | 92 | 1.19M | { | 93 | 1.19M | shrink_vector (0); | 94 | 1.19M | hb_free (arrayZ); | 95 | 1.19M | init (); | 96 | 1.19M | } |
hb_vector_t<unsigned int, false>::fini() Line | Count | Source | 92 | 395k | { | 93 | 395k | shrink_vector (0); | 94 | 395k | hb_free (arrayZ); | 95 | 395k | init (); | 96 | 395k | } |
hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::fini() Line | Count | Source | 92 | 302k | { | 93 | 302k | shrink_vector (0); | 94 | 302k | hb_free (arrayZ); | 95 | 302k | init (); | 96 | 302k | } |
hb_vector_t<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, false>::fini() Line | Count | Source | 92 | 10.3k | { | 93 | 10.3k | shrink_vector (0); | 94 | 10.3k | hb_free (arrayZ); | 95 | 10.3k | init (); | 96 | 10.3k | } |
hb_vector_t<hb_serialize_context_t::object_t*, false>::fini() Line | Count | Source | 92 | 30.9k | { | 93 | 30.9k | shrink_vector (0); | 94 | 30.9k | hb_free (arrayZ); | 95 | 30.9k | init (); | 96 | 30.9k | } |
Unexecuted instantiation: hb_vector_t<hb_vector_t<unsigned int, false>, false>::fini() Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, true>::fini() Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::fini() hb_vector_t<int, false>::fini() Line | Count | Source | 92 | 130k | { | 93 | 130k | shrink_vector (0); | 94 | 130k | hb_free (arrayZ); | 95 | 130k | init (); | 96 | 130k | } |
Unexecuted instantiation: hb_vector_t<unsigned int, true>::fini() Unexecuted instantiation: hb_vector_t<OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t, false>::fini() Unexecuted instantiation: hb_vector_t<hb_set_t, false>::fini() hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::fini() Line | Count | Source | 92 | 1.55M | { | 93 | 1.55M | shrink_vector (0); | 94 | 1.55M | hb_free (arrayZ); | 95 | 1.55M | init (); | 96 | 1.55M | } |
hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::fini() Line | Count | Source | 92 | 148k | { | 93 | 148k | shrink_vector (0); | 94 | 148k | hb_free (arrayZ); | 95 | 148k | init (); | 96 | 148k | } |
Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::fini() hb_vector_t<hb_transform_t, false>::fini() Line | Count | Source | 92 | 19.3k | { | 93 | 19.3k | shrink_vector (0); | 94 | 19.3k | hb_free (arrayZ); | 95 | 19.3k | init (); | 96 | 19.3k | } |
hb_vector_t<hb_bounds_t, false>::fini() Line | Count | Source | 92 | 38.7k | { | 93 | 38.7k | shrink_vector (0); | 94 | 38.7k | hb_free (arrayZ); | 95 | 38.7k | init (); | 96 | 38.7k | } |
Unexecuted instantiation: hb_vector_t<OT::LayerRecord, false>::fini() Unexecuted instantiation: hb_vector_t<hb_set_t*, false>::fini() Unexecuted instantiation: hb_vector_t<OT::index_map_subset_plan_t, false>::fini() Unexecuted instantiation: hb_vector_t<OT::DeltaSetIndexMap const*, false>::fini() hb_vector_t<OT::contour_point_t, false>::fini() Line | Count | Source | 92 | 616k | { | 93 | 616k | shrink_vector (0); | 94 | 616k | hb_free (arrayZ); | 95 | 616k | init (); | 96 | 616k | } |
Unexecuted instantiation: hb_vector_t<unsigned char, false>::fini() Unexecuted instantiation: hb_vector_t<OT::glyf_impl::SubsetGlyph, false>::fini() Unexecuted instantiation: hb_vector_t<hb_variation_t, false>::fini() Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, false>::fini() Unexecuted instantiation: hb_vector_t<OT::IndexSubtableRecord, false>::fini() hb_vector_t<char, false>::fini() Line | Count | Source | 92 | 2.83k | { | 93 | 2.83k | shrink_vector (0); | 94 | 2.83k | hb_free (arrayZ); | 95 | 2.83k | init (); | 96 | 2.83k | } |
Unexecuted instantiation: hb_vector_t<OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*, false>::fini() hb_vector_t<hb_ot_name_entry_t, false>::fini() Line | Count | Source | 92 | 197k | { | 93 | 197k | shrink_vector (0); | 94 | 197k | hb_free (arrayZ); | 95 | 197k | init (); | 96 | 197k | } |
hb_vector_t<OT::cff1::accelerator_t::gname_t, true>::fini() Line | Count | Source | 92 | 18.6k | { | 93 | 18.6k | shrink_vector (0); | 94 | 18.6k | hb_free (arrayZ); | 95 | 18.6k | init (); | 96 | 18.6k | } |
hb_vector_t<CFF::cff1_top_dict_val_t, false>::fini() Line | Count | Source | 92 | 563k | { | 93 | 563k | shrink_vector (0); | 94 | 563k | hb_free (arrayZ); | 95 | 563k | init (); | 96 | 563k | } |
hb_vector_t<CFF::cff1_font_dict_values_t, false>::fini() Line | Count | Source | 92 | 563k | { | 93 | 563k | shrink_vector (0); | 94 | 563k | hb_free (arrayZ); | 95 | 563k | init (); | 96 | 563k | } |
hb_vector_t<CFF::op_str_t, false>::fini() Line | Count | Source | 92 | 1.69M | { | 93 | 1.69M | shrink_vector (0); | 94 | 1.69M | hb_free (arrayZ); | 95 | 1.69M | init (); | 96 | 1.69M | } |
hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::fini() Line | Count | Source | 92 | 563k | { | 93 | 563k | shrink_vector (0); | 94 | 563k | hb_free (arrayZ); | 95 | 563k | init (); | 96 | 563k | } |
hb_vector_t<CFF::dict_val_t, false>::fini() Line | Count | Source | 92 | 942k | { | 93 | 942k | shrink_vector (0); | 94 | 942k | hb_free (arrayZ); | 95 | 942k | init (); | 96 | 942k | } |
hb_vector_t<CFF::cff2_font_dict_values_t, false>::fini() Line | Count | Source | 92 | 469k | { | 93 | 469k | shrink_vector (0); | 94 | 469k | hb_free (arrayZ); | 95 | 469k | init (); | 96 | 469k | } |
hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::fini() Line | Count | Source | 92 | 469k | { | 93 | 469k | shrink_vector (0); | 94 | 469k | hb_free (arrayZ); | 95 | 469k | init (); | 96 | 469k | } |
Unexecuted instantiation: hb_vector_t<hb_array_t<unsigned char const>, false>::fini() Unexecuted instantiation: hb_vector_t<hb_ot_name_record_ids_t, false>::fini() hb_vector_t<float, false>::fini() Line | Count | Source | 92 | 20.8k | { | 93 | 20.8k | shrink_vector (0); | 94 | 20.8k | hb_free (arrayZ); | 95 | 20.8k | init (); | 96 | 20.8k | } |
hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::fini() Line | Count | Source | 92 | 588k | { | 93 | 588k | shrink_vector (0); | 94 | 588k | hb_free (arrayZ); | 95 | 588k | init (); | 96 | 588k | } |
hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::fini() Line | Count | Source | 92 | 1.17M | { | 93 | 1.17M | shrink_vector (0); | 94 | 1.17M | hb_free (arrayZ); | 95 | 1.17M | init (); | 96 | 1.17M | } |
|
97 | | |
98 | | void reset () |
99 | 319k | { |
100 | 319k | if (unlikely (in_error ())) |
101 | | /* Big Hack! We don't know the true allocated size before |
102 | | * an allocation failure happened. But we know it was at |
103 | | * least as big as length. Restore it to that and continue |
104 | | * as if error did not happen. */ |
105 | 0 | allocated = length; |
106 | 319k | resize (0); |
107 | 319k | } Unexecuted instantiation: hb_vector_t<hb_bit_set_t::page_map_t, true>::reset() Unexecuted instantiation: hb_vector_t<hb_bit_page_t, false>::reset() Unexecuted instantiation: hb_vector_t<hb_set_t, false>::reset() Unexecuted instantiation: hb_vector_t<unsigned int, true>::reset() hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::reset() Line | Count | Source | 99 | 146k | { | 100 | 146k | if (unlikely (in_error ())) | 101 | | /* Big Hack! We don't know the true allocated size before | 102 | | * an allocation failure happened. But we know it was at | 103 | | * least as big as length. Restore it to that and continue | 104 | | * as if error did not happen. */ | 105 | 0 | allocated = length; | 106 | 146k | resize (0); | 107 | 146k | } |
hb_vector_t<OT::contour_point_t, false>::reset() Line | Count | Source | 99 | 172k | { | 100 | 172k | if (unlikely (in_error ())) | 101 | | /* Big Hack! We don't know the true allocated size before | 102 | | * an allocation failure happened. But we know it was at | 103 | | * least as big as length. Restore it to that and continue | 104 | | * as if error did not happen. */ | 105 | 0 | allocated = length; | 106 | 172k | resize (0); | 107 | 172k | } |
|
108 | | |
109 | | friend void swap (hb_vector_t& a, hb_vector_t& b) |
110 | 853k | { |
111 | 853k | hb_swap (a.allocated, b.allocated); |
112 | 853k | hb_swap (a.length, b.length); |
113 | 853k | hb_swap (a.arrayZ, b.arrayZ); |
114 | 853k | } Unexecuted instantiation: swap(hb_vector_t<hb_aat_map_t::range_flags_t, true>&, hb_vector_t<hb_aat_map_t::range_flags_t, true>&) Unexecuted instantiation: swap(hb_vector_t<hb_bit_set_t::page_map_t, true>&, hb_vector_t<hb_bit_set_t::page_map_t, true>&) Unexecuted instantiation: swap(hb_vector_t<hb_bit_page_t, false>&, hb_vector_t<hb_bit_page_t, false>&) Unexecuted instantiation: swap(hb_vector_t<hb_serialize_context_t::object_t::link_t, false>&, hb_vector_t<hb_serialize_context_t::object_t::link_t, false>&) Unexecuted instantiation: swap(hb_vector_t<unsigned int, false>&, hb_vector_t<unsigned int, false>&) Unexecuted instantiation: swap(hb_vector_t<CFF::dict_val_t, false>&, hb_vector_t<CFF::dict_val_t, false>&) swap(hb_vector_t<CFF::op_str_t, false>&, hb_vector_t<CFF::op_str_t, false>&) Line | Count | Source | 110 | 853k | { | 111 | 853k | hb_swap (a.allocated, b.allocated); | 112 | 853k | hb_swap (a.length, b.length); | 113 | 853k | hb_swap (a.arrayZ, b.arrayZ); | 114 | 853k | } |
|
115 | | |
116 | | hb_vector_t& operator = (const hb_vector_t &o) |
117 | 146k | { |
118 | 146k | reset (); |
119 | 146k | alloc (o.length, true); |
120 | 146k | if (unlikely (in_error ())) return *this; |
121 | | |
122 | 146k | copy_vector (o); |
123 | | |
124 | 146k | return *this; |
125 | 146k | } Unexecuted instantiation: hb_vector_t<hb_bit_set_t::page_map_t, true>::operator=(hb_vector_t<hb_bit_set_t::page_map_t, true> const&) Unexecuted instantiation: hb_vector_t<hb_bit_page_t, false>::operator=(hb_vector_t<hb_bit_page_t, false> const&) hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::operator=(hb_vector_t<hb_aat_map_builder_t::feature_info_t, true> const&) Line | Count | Source | 117 | 146k | { | 118 | 146k | reset (); | 119 | 146k | alloc (o.length, true); | 120 | 146k | if (unlikely (in_error ())) return *this; | 121 | | | 122 | 146k | copy_vector (o); | 123 | | | 124 | 146k | return *this; | 125 | 146k | } |
|
126 | | hb_vector_t& operator = (hb_vector_t &&o) |
127 | 853k | { |
128 | 853k | hb_swap (*this, o); |
129 | 853k | return *this; |
130 | 853k | } Unexecuted instantiation: hb_vector_t<hb_aat_map_t::range_flags_t, true>::operator=(hb_vector_t<hb_aat_map_t::range_flags_t, true>&&) Unexecuted instantiation: hb_vector_t<unsigned int, false>::operator=(hb_vector_t<unsigned int, false>&&) Unexecuted instantiation: hb_vector_t<CFF::dict_val_t, false>::operator=(hb_vector_t<CFF::dict_val_t, false>&&) hb_vector_t<CFF::op_str_t, false>::operator=(hb_vector_t<CFF::op_str_t, false>&&) Line | Count | Source | 127 | 853k | { | 128 | 853k | hb_swap (*this, o); | 129 | 853k | return *this; | 130 | 853k | } |
|
131 | | |
132 | | hb_bytes_t as_bytes () const |
133 | 272k | { return hb_bytes_t ((const char *) arrayZ, get_size ()); } |
134 | | |
135 | | bool operator == (const hb_vector_t &o) const { return as_array () == o.as_array (); } |
136 | | bool operator != (const hb_vector_t &o) const { return !(*this == o); } |
137 | | uint32_t hash () const { return as_array ().hash (); } |
138 | | |
139 | | Type& operator [] (int i_) |
140 | 83.7M | { |
141 | 83.7M | unsigned int i = (unsigned int) i_; |
142 | 83.7M | if (unlikely (i >= length)) |
143 | 9.32M | return Crap (Type); |
144 | 74.4M | return arrayZ[i]; |
145 | 83.7M | } hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::operator[](int) Line | Count | Source | 140 | 164k | { | 141 | 164k | unsigned int i = (unsigned int) i_; | 142 | 164k | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 164k | return arrayZ[i]; | 145 | 164k | } |
hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::operator[](int) Line | Count | Source | 140 | 196k | { | 141 | 196k | unsigned int i = (unsigned int) i_; | 142 | 196k | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 196k | return arrayZ[i]; | 145 | 196k | } |
hb_vector_t<hb_bit_set_t::page_map_t, true>::operator[](int) Line | Count | Source | 140 | 14.2M | { | 141 | 14.2M | unsigned int i = (unsigned int) i_; | 142 | 14.2M | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 14.2M | return arrayZ[i]; | 145 | 14.2M | } |
hb_vector_t<unsigned int, false>::operator[](int) Line | Count | Source | 140 | 735k | { | 141 | 735k | unsigned int i = (unsigned int) i_; | 142 | 735k | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 735k | return arrayZ[i]; | 145 | 735k | } |
hb_vector_t<hb_bit_page_t, false>::operator[](int) Line | Count | Source | 140 | 266k | { | 141 | 266k | unsigned int i = (unsigned int) i_; | 142 | 266k | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 266k | return arrayZ[i]; | 145 | 266k | } |
hb_vector_t<hb_serialize_context_t::object_t*, false>::operator[](int) Line | Count | Source | 140 | 151k | { | 141 | 151k | unsigned int i = (unsigned int) i_; | 142 | 151k | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 151k | return arrayZ[i]; | 145 | 151k | } |
Unexecuted instantiation: hb_vector_t<hb_vector_t<unsigned int, false>, false>::operator[](int) Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, true>::operator[](int) Unexecuted instantiation: hb_vector_t<OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t, false>::operator[](int) Unexecuted instantiation: hb_vector_t<hb_set_t, false>::operator[](int) hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::operator[](int) Line | Count | Source | 140 | 4.54M | { | 141 | 4.54M | unsigned int i = (unsigned int) i_; | 142 | 4.54M | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 4.54M | return arrayZ[i]; | 145 | 4.54M | } |
Unexecuted instantiation: hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::operator[](int) hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::operator[](int) Line | Count | Source | 140 | 146k | { | 141 | 146k | unsigned int i = (unsigned int) i_; | 142 | 146k | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 146k | return arrayZ[i]; | 145 | 146k | } |
Unexecuted instantiation: hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::operator[](int) hb_vector_t<hb_aat_map_t::range_flags_t, true>::operator[](int) Line | Count | Source | 140 | 164k | { | 141 | 164k | unsigned int i = (unsigned int) i_; | 142 | 164k | if (unlikely (i >= length)) | 143 | 1.92k | return Crap (Type); | 144 | 162k | return arrayZ[i]; | 145 | 164k | } |
hb_vector_t<hb_bounds_t, false>::operator[](int) Line | Count | Source | 140 | 4.12M | { | 141 | 4.12M | unsigned int i = (unsigned int) i_; | 142 | 4.12M | if (unlikely (i >= length)) | 143 | 925 | return Crap (Type); | 144 | 4.12M | return arrayZ[i]; | 145 | 4.12M | } |
hb_vector_t<hb_transform_t, false>::operator[](int) Line | Count | Source | 140 | 691k | { | 141 | 691k | unsigned int i = (unsigned int) i_; | 142 | 691k | if (unlikely (i >= length)) | 143 | 413 | return Crap (Type); | 144 | 691k | return arrayZ[i]; | 145 | 691k | } |
Unexecuted instantiation: hb_vector_t<OT::LayerRecord, false>::operator[](int) Unexecuted instantiation: hb_vector_t<hb_set_t*, false>::operator[](int) Unexecuted instantiation: hb_vector_t<OT::index_map_subset_plan_t, false>::operator[](int) Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::operator[](int) hb_vector_t<OT::contour_point_t, false>::operator[](int) Line | Count | Source | 140 | 28.6M | { | 141 | 28.6M | unsigned int i = (unsigned int) i_; | 142 | 28.6M | if (unlikely (i >= length)) | 143 | 9.32M | return Crap (Type); | 144 | 19.3M | return arrayZ[i]; | 145 | 28.6M | } |
hb_vector_t<int, false>::operator[](int) Line | Count | Source | 140 | 1.60M | { | 141 | 1.60M | unsigned int i = (unsigned int) i_; | 142 | 1.60M | if (unlikely (i >= length)) | 143 | 19 | return Crap (Type); | 144 | 1.60M | return arrayZ[i]; | 145 | 1.60M | } |
Unexecuted instantiation: hb_vector_t<OT::glyf_impl::SubsetGlyph, false>::operator[](int) Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, false>::operator[](int) Unexecuted instantiation: hb_vector_t<OT::IndexSubtableRecord, false>::operator[](int) Unexecuted instantiation: hb_vector_t<OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*, false>::operator[](int) Unexecuted instantiation: hb_vector_t<hb_array_t<unsigned char const>, false>::operator[](int) hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::operator[](int) Line | Count | Source | 140 | 926k | { | 141 | 926k | unsigned int i = (unsigned int) i_; | 142 | 926k | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 926k | return arrayZ[i]; | 145 | 926k | } |
hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::operator[](int) Line | Count | Source | 140 | 136k | { | 141 | 136k | unsigned int i = (unsigned int) i_; | 142 | 136k | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 136k | return arrayZ[i]; | 145 | 136k | } |
hb_vector_t<hb_ot_name_entry_t, false>::operator[](int) Line | Count | Source | 140 | 16.3M | { | 141 | 16.3M | unsigned int i = (unsigned int) i_; | 142 | 16.3M | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 16.3M | return arrayZ[i]; | 145 | 16.3M | } |
hb_vector_t<float, false>::operator[](int) Line | Count | Source | 140 | 195 | { | 141 | 195 | unsigned int i = (unsigned int) i_; | 142 | 195 | if (unlikely (i >= length)) | 143 | 32 | return Crap (Type); | 144 | 163 | return arrayZ[i]; | 145 | 195 | } |
hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::operator[](int) Line | Count | Source | 140 | 8.06M | { | 141 | 8.06M | unsigned int i = (unsigned int) i_; | 142 | 8.06M | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 8.06M | return arrayZ[i]; | 145 | 8.06M | } |
hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::operator[](int) Line | Count | Source | 140 | 2.59M | { | 141 | 2.59M | unsigned int i = (unsigned int) i_; | 142 | 2.59M | if (unlikely (i >= length)) | 143 | 0 | return Crap (Type); | 144 | 2.59M | return arrayZ[i]; | 145 | 2.59M | } |
|
146 | | const Type& operator [] (int i_) const |
147 | 296M | { |
148 | 296M | unsigned int i = (unsigned int) i_; |
149 | 296M | if (unlikely (i >= length)) |
150 | 7.25k | return Null (Type); |
151 | 296M | return arrayZ[i]; |
152 | 296M | } hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::operator[](int) const Line | Count | Source | 147 | 168k | { | 148 | 168k | unsigned int i = (unsigned int) i_; | 149 | 168k | if (unlikely (i >= length)) | 150 | 4.58k | return Null (Type); | 151 | 164k | return arrayZ[i]; | 152 | 168k | } |
Unexecuted instantiation: hb_vector_t<hb_aat_map_t::range_flags_t, true>::operator[](int) const hb_vector_t<hb_ot_map_t::stage_map_t, false>::operator[](int) const Line | Count | Source | 147 | 8.99M | { | 148 | 8.99M | unsigned int i = (unsigned int) i_; | 149 | 8.99M | if (unlikely (i >= length)) | 150 | 0 | return Null (Type); | 151 | 8.99M | return arrayZ[i]; | 152 | 8.99M | } |
Unexecuted instantiation: hb_vector_t<hb_bit_page_t, false>::operator[](int) const Unexecuted instantiation: hb_vector_t<hb_bit_set_t::page_map_t, true>::operator[](int) const hb_vector_t<unsigned int, false>::operator[](int) const Line | Count | Source | 147 | 279M | { | 148 | 279M | unsigned int i = (unsigned int) i_; | 149 | 279M | if (unlikely (i >= length)) | 150 | 0 | return Null (Type); | 151 | 279M | return arrayZ[i]; | 152 | 279M | } |
Unexecuted instantiation: hb_vector_t<hb_vector_t<unsigned int, false>, false>::operator[](int) const hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::operator[](int) const Line | Count | Source | 147 | 51.2k | { | 148 | 51.2k | unsigned int i = (unsigned int) i_; | 149 | 51.2k | if (unlikely (i >= length)) | 150 | 0 | return Null (Type); | 151 | 51.2k | return arrayZ[i]; | 152 | 51.2k | } |
Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::operator[](int) const Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::operator[](int) const Unexecuted instantiation: hb_vector_t<OT::contour_point_t, false>::operator[](int) const Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, false>::operator[](int) const Unexecuted instantiation: hb_vector_t<CFF::code_pair_t, false>::operator[](int) const Unexecuted instantiation: hb_vector_t<CFF::op_str_t, false>::operator[](int) const Unexecuted instantiation: hb_vector_t<hb_ot_name_record_ids_t, false>::operator[](int) const hb_vector_t<hb_ot_map_t::lookup_map_t, false>::operator[](int) const Line | Count | Source | 147 | 7.86M | { | 148 | 7.86M | unsigned int i = (unsigned int) i_; | 149 | 7.86M | if (unlikely (i >= length)) | 150 | 0 | return Null (Type); | 151 | 7.86M | return arrayZ[i]; | 152 | 7.86M | } |
hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::operator[](int) const Line | Count | Source | 147 | 50.4k | { | 148 | 50.4k | unsigned int i = (unsigned int) i_; | 149 | 50.4k | if (unlikely (i >= length)) | 150 | 73 | return Null (Type); | 151 | 50.3k | return arrayZ[i]; | 152 | 50.4k | } |
hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::operator[](int) const Line | Count | Source | 147 | 41.6k | { | 148 | 41.6k | unsigned int i = (unsigned int) i_; | 149 | 41.6k | if (unlikely (i >= length)) | 150 | 2.59k | return Null (Type); | 151 | 39.0k | return arrayZ[i]; | 152 | 41.6k | } |
|
153 | | |
154 | 5.17M | Type& tail () { return (*this)[length - 1]; } hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::tail() Line | Count | Source | 154 | 196k | Type& tail () { return (*this)[length - 1]; } |
Unexecuted instantiation: hb_vector_t<hb_serialize_context_t::object_t*, false>::tail() Unexecuted instantiation: hb_vector_t<hb_set_t, false>::tail() hb_vector_t<hb_aat_map_t::range_flags_t, true>::tail() Line | Count | Source | 154 | 164k | Type& tail () { return (*this)[length - 1]; } |
hb_vector_t<hb_bounds_t, false>::tail() Line | Count | Source | 154 | 4.12M | Type& tail () { return (*this)[length - 1]; } |
hb_vector_t<hb_transform_t, false>::tail() Line | Count | Source | 154 | 691k | Type& tail () { return (*this)[length - 1]; } |
Unexecuted instantiation: hb_vector_t<OT::IndexSubtableRecord, false>::tail() |
155 | | const Type& tail () const { return (*this)[length - 1]; } |
156 | | |
157 | 0 | explicit operator bool () const { return length; } Unexecuted instantiation: hb_vector_t<unsigned int, true>::operator bool() const Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, true>::operator bool() const Unexecuted instantiation: hb_vector_t<hb_set_t, false>::operator bool() const Unexecuted instantiation: hb_vector_t<int, false>::operator bool() const |
158 | 272k | unsigned get_size () const { return length * item_size; } |
159 | | |
160 | | /* Sink interface. */ |
161 | | template <typename T> |
162 | 21.9M | hb_vector_t& operator << (T&& v) { push (std::forward<T> (v)); return *this; } Unexecuted instantiation: hb_vector_t<unsigned int, true>& hb_vector_t<unsigned int, true>::operator<< <unsigned int const&>(unsigned int const&) Unexecuted instantiation: hb_vector_t<unsigned int, true>& hb_vector_t<unsigned int, true>::operator<< <unsigned int>(unsigned int&&) Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>& hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::operator<< <hb_pair_t<unsigned int, unsigned int> const&>(hb_pair_t<unsigned int, unsigned int> const&) hb_vector_t<int, false>& hb_vector_t<int, false>::operator<< <int&>(int&) Line | Count | Source | 162 | 21.9M | hb_vector_t& operator << (T&& v) { push (std::forward<T> (v)); return *this; } |
|
163 | | |
164 | 5.34M | array_t as_array () { return hb_array (arrayZ, length); } hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::as_array() Line | Count | Source | 164 | 591k | array_t as_array () { return hb_array (arrayZ, length); } |
hb_vector_t<unsigned int, false>::as_array() Line | Count | Source | 164 | 86.7k | array_t as_array () { return hb_array (arrayZ, length); } |
Unexecuted instantiation: hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::as_array() Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::as_array() hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::as_array() Line | Count | Source | 164 | 148k | array_t as_array () { return hb_array (arrayZ, length); } |
hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::as_array() Line | Count | Source | 164 | 146k | array_t as_array () { return hb_array (arrayZ, length); } |
Unexecuted instantiation: hb_vector_t<OT::DeltaSetIndexMap const*, false>::as_array() Unexecuted instantiation: hb_vector_t<OT::index_map_subset_plan_t, false>::as_array() hb_vector_t<OT::contour_point_t, false>::as_array() Line | Count | Source | 164 | 3.66M | array_t as_array () { return hb_array (arrayZ, length); } |
hb_vector_t<int, false>::as_array() Line | Count | Source | 164 | 42.9k | array_t as_array () { return hb_array (arrayZ, length); } |
Unexecuted instantiation: hb_vector_t<OT::glyf_impl::SubsetGlyph, false>::as_array() hb_vector_t<OT::cff1::accelerator_t::gname_t, true>::as_array() Line | Count | Source | 164 | 37.2k | array_t as_array () { return hb_array (arrayZ, length); } |
hb_vector_t<hb_ot_name_entry_t, false>::as_array() Line | Count | Source | 164 | 197k | array_t as_array () { return hb_array (arrayZ, length); } |
hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::as_array() Line | Count | Source | 164 | 292k | array_t as_array () { return hb_array (arrayZ, length); } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::as_array() Line | Count | Source | 164 | 134k | array_t as_array () { return hb_array (arrayZ, length); } |
|
165 | 90.6M | c_array_t as_array () const { return hb_array (arrayZ, length); } hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::as_array() const Line | Count | Source | 165 | 337k | c_array_t as_array () const { return hb_array (arrayZ, length); } |
hb_vector_t<hb_aat_map_t::range_flags_t, true>::as_array() const Line | Count | Source | 165 | 271k | c_array_t as_array () const { return hb_array (arrayZ, length); } |
hb_vector_t<hb_ot_map_t::feature_map_t, true>::as_array() const Line | Count | Source | 165 | 3.07M | c_array_t as_array () const { return hb_array (arrayZ, length); } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::as_array() const Line | Count | Source | 165 | 14.7k | c_array_t as_array () const { return hb_array (arrayZ, length); } |
hb_vector_t<hb_bit_set_t::page_map_t, true>::as_array() const Line | Count | Source | 165 | 9.06M | c_array_t as_array () const { return hb_array (arrayZ, length); } |
Unexecuted instantiation: hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::as_array() const hb_vector_t<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, false>::as_array() const Line | Count | Source | 165 | 10.3k | c_array_t as_array () const { return hb_array (arrayZ, length); } |
hb_vector_t<hb_serialize_context_t::object_t*, false>::as_array() const Line | Count | Source | 165 | 29.3k | c_array_t as_array () const { return hb_array (arrayZ, length); } |
Unexecuted instantiation: hb_vector_t<unsigned int, false>::as_array() const Unexecuted instantiation: hb_vector_t<unsigned int, true>::as_array() const Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, true>::as_array() const Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::as_array() const hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::as_array() const Line | Count | Source | 165 | 77.8M | c_array_t as_array () const { return hb_array (arrayZ, length); } |
Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::as_array() const Unexecuted instantiation: hb_vector_t<OT::LayerRecord, false>::as_array() const Unexecuted instantiation: hb_vector_t<hb_array_t<unsigned char const>, false>::as_array() const |
166 | | |
167 | | /* Iterator. */ |
168 | | typedef c_array_t iter_t; |
169 | | typedef array_t writer_t; |
170 | 78.1M | iter_t iter () const { return as_array (); } hb_vector_t<hb_aat_map_t::range_flags_t, true>::iter() const Line | Count | Source | 170 | 271k | iter_t iter () const { return as_array (); } |
Unexecuted instantiation: hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::iter() const hb_vector_t<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, false>::iter() const Line | Count | Source | 170 | 10.3k | iter_t iter () const { return as_array (); } |
hb_vector_t<hb_serialize_context_t::object_t*, false>::iter() const Line | Count | Source | 170 | 29.3k | iter_t iter () const { return as_array (); } |
Unexecuted instantiation: hb_vector_t<unsigned int, true>::iter() const Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, true>::iter() const Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::iter() const hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::iter() const Line | Count | Source | 170 | 77.8M | iter_t iter () const { return as_array (); } |
Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::iter() const Unexecuted instantiation: hb_vector_t<unsigned int, false>::iter() const Unexecuted instantiation: hb_vector_t<hb_array_t<unsigned char const>, false>::iter() const |
171 | 86.7k | writer_t writer () { return as_array (); } hb_vector_t<unsigned int, false>::writer() Line | Count | Source | 171 | 86.7k | writer_t writer () { return as_array (); } |
Unexecuted instantiation: hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::writer() Unexecuted instantiation: hb_vector_t<OT::glyf_impl::SubsetGlyph, false>::writer() |
172 | 0 | operator iter_t () const { return iter (); } |
173 | 34.4k | operator writer_t () { return writer (); } |
174 | | |
175 | | /* Faster range-based for loop. */ |
176 | 3.15M | Type *begin () const { return arrayZ; } Unexecuted instantiation: hb_vector_t<hb_bit_set_t::page_map_t, true>::begin() const hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::begin() const Line | Count | Source | 176 | 141k | Type *begin () const { return arrayZ; } |
hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::begin() const Line | Count | Source | 176 | 1.55M | Type *begin () const { return arrayZ; } |
hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::begin() const Line | Count | Source | 176 | 148k | Type *begin () const { return arrayZ; } |
Unexecuted instantiation: hb_vector_t<unsigned int, false>::begin() const hb_vector_t<hb_ot_map_t::feature_map_t, true>::begin() const Line | Count | Source | 176 | 1.30M | Type *begin () const { return arrayZ; } |
|
177 | 3.15M | Type *end () const { return arrayZ + length; } Unexecuted instantiation: hb_vector_t<hb_bit_set_t::page_map_t, true>::end() const hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::end() const Line | Count | Source | 177 | 141k | Type *end () const { return arrayZ + length; } |
hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::end() const Line | Count | Source | 177 | 1.55M | Type *end () const { return arrayZ + length; } |
hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::end() const Line | Count | Source | 177 | 148k | Type *end () const { return arrayZ + length; } |
Unexecuted instantiation: hb_vector_t<unsigned int, false>::end() const hb_vector_t<hb_ot_map_t::feature_map_t, true>::end() const Line | Count | Source | 177 | 1.30M | Type *end () const { return arrayZ + length; } |
|
178 | | |
179 | | |
180 | | hb_sorted_array_t<Type> as_sorted_array () |
181 | | { return hb_sorted_array (arrayZ, length); } |
182 | | hb_sorted_array_t<const Type> as_sorted_array () const |
183 | | { return hb_sorted_array (arrayZ, length); } |
184 | | |
185 | | template <typename T> explicit operator T * () { return arrayZ; } |
186 | 1.33M | template <typename T> explicit operator const T * () const { return arrayZ; } |
187 | | |
188 | | Type * operator + (unsigned int i) { return arrayZ + i; } |
189 | | const Type * operator + (unsigned int i) const { return arrayZ + i; } |
190 | | |
191 | | Type *push () |
192 | 27.7M | { |
193 | 27.7M | if (unlikely (!resize (length + 1))) |
194 | 213k | return &Crap (Type); |
195 | 27.5M | return std::addressof (arrayZ[length - 1]); |
196 | 27.7M | } hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::push() Line | Count | Source | 192 | 139k | { | 193 | 139k | if (unlikely (!resize (length + 1))) | 194 | 663 | return &Crap (Type); | 195 | 138k | return std::addressof (arrayZ[length - 1]); | 196 | 139k | } |
Unexecuted instantiation: hb_vector_t<hb_vector_t<unsigned int, false>, false>::push() Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::push() Unexecuted instantiation: hb_vector_t<hb_set_t, false>::push() hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::push() Line | Count | Source | 192 | 2.32M | { | 193 | 2.32M | if (unlikely (!resize (length + 1))) | 194 | 14.2k | return &Crap (Type); | 195 | 2.30M | return std::addressof (arrayZ[length - 1]); | 196 | 2.32M | } |
Unexecuted instantiation: hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::push() hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::push() Line | Count | Source | 192 | 148k | { | 193 | 148k | if (unlikely (!resize (length + 1))) | 194 | 1.53k | return &Crap (Type); | 195 | 146k | return std::addressof (arrayZ[length - 1]); | 196 | 148k | } |
hb_vector_t<CFF::cff1_font_dict_values_t, false>::push() Line | Count | Source | 192 | 348k | { | 193 | 348k | if (unlikely (!resize (length + 1))) | 194 | 42 | return &Crap (Type); | 195 | 348k | return std::addressof (arrayZ[length - 1]); | 196 | 348k | } |
hb_vector_t<CFF::cff2_font_dict_values_t, false>::push() Line | Count | Source | 192 | 27.2k | { | 193 | 27.2k | if (unlikely (!resize (length + 1))) | 194 | 58 | return &Crap (Type); | 195 | 27.1k | return std::addressof (arrayZ[length - 1]); | 196 | 27.2k | } |
hb_vector_t<hb_ot_name_entry_t, false>::push() Line | Count | Source | 192 | 5.62M | { | 193 | 5.62M | if (unlikely (!resize (length + 1))) | 194 | 8.88k | return &Crap (Type); | 195 | 5.61M | return std::addressof (arrayZ[length - 1]); | 196 | 5.62M | } |
hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::push() Line | Count | Source | 192 | 8.29M | { | 193 | 8.29M | if (unlikely (!resize (length + 1))) | 194 | 98.6k | return &Crap (Type); | 195 | 8.19M | return std::addressof (arrayZ[length - 1]); | 196 | 8.29M | } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::push() Line | Count | Source | 192 | 7.40M | { | 193 | 7.40M | if (unlikely (!resize (length + 1))) | 194 | 70.9k | return &Crap (Type); | 195 | 7.33M | return std::addressof (arrayZ[length - 1]); | 196 | 7.40M | } |
hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::push() Line | Count | Source | 192 | 1.30M | { | 193 | 1.30M | if (unlikely (!resize (length + 1))) | 194 | 8.14k | return &Crap (Type); | 195 | 1.29M | return std::addressof (arrayZ[length - 1]); | 196 | 1.30M | } |
hb_vector_t<hb_ot_map_t::feature_map_t, true>::push() Line | Count | Source | 192 | 806k | { | 193 | 806k | if (unlikely (!resize (length + 1))) | 194 | 3.27k | return &Crap (Type); | 195 | 803k | return std::addressof (arrayZ[length - 1]); | 196 | 806k | } |
hb_vector_t<hb_ot_map_t::stage_map_t, false>::push() Line | Count | Source | 192 | 1.29M | { | 193 | 1.29M | if (unlikely (!resize (length + 1))) | 194 | 6.88k | return &Crap (Type); | 195 | 1.29M | return std::addressof (arrayZ[length - 1]); | 196 | 1.29M | } |
|
197 | | template <typename T, |
198 | | typename T2 = Type, |
199 | | hb_enable_if (!std::is_copy_constructible<T2>::value && |
200 | | std::is_copy_assignable<T>::value)> |
201 | | Type *push (T&& v) |
202 | | { |
203 | | Type *p = push (); |
204 | | if (p == &Crap (Type)) |
205 | | // If push failed to allocate then don't copy v, since this may cause |
206 | | // the created copy to leak memory since we won't have stored a |
207 | | // reference to it. |
208 | | return p; |
209 | | *p = std::forward<T> (v); |
210 | | return p; |
211 | | } |
212 | | template <typename T, |
213 | | typename T2 = Type, |
214 | | hb_enable_if (std::is_copy_constructible<T2>::value)> |
215 | | Type *push (T&& v) |
216 | 56.0M | { |
217 | 56.0M | if (unlikely (!alloc (length + 1))) |
218 | | // If push failed to allocate then don't copy v, since this may cause |
219 | | // the created copy to leak memory since we won't have stored a |
220 | | // reference to it. |
221 | 357k | return &Crap (Type); |
222 | | |
223 | | /* Emplace. */ |
224 | 55.7M | length++; |
225 | 55.7M | Type *p = std::addressof (arrayZ[length - 1]); |
226 | 55.7M | return new (p) Type (std::forward<T> (v)); |
227 | 56.0M | } hb_aat_map_t::range_flags_t* hb_vector_t<hb_aat_map_t::range_flags_t, true>::push<hb_aat_map_t::range_flags_t, hb_aat_map_t::range_flags_t, (void*)0>(hb_aat_map_t::range_flags_t&&) Line | Count | Source | 216 | 164k | { | 217 | 164k | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 1.92k | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 162k | length++; | 225 | 162k | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 162k | return new (p) Type (std::forward<T> (v)); | 227 | 164k | } |
hb_user_data_array_t::hb_user_data_item_t* hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::push<hb_user_data_array_t::hb_user_data_item_t&, hb_user_data_array_t::hb_user_data_item_t, (void*)0>(hb_user_data_array_t::hb_user_data_item_t&) Line | Count | Source | 216 | 200k | { | 217 | 200k | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 3.89k | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 196k | length++; | 225 | 196k | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 196k | return new (p) Type (std::forward<T> (v)); | 227 | 200k | } |
Unexecuted instantiation: hb_serialize_context_t::object_t::link_t* hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::push<hb_link_t&, hb_serialize_context_t::object_t::link_t, (void*)0>(hb_link_t&) hb_serialize_context_t::object_t** hb_vector_t<hb_serialize_context_t::object_t*, false>::push<decltype(nullptr), hb_serialize_context_t::object_t*, (void*)0>(decltype(nullptr)&&) Line | Count | Source | 216 | 10.3k | { | 217 | 10.3k | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 220 | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 10.0k | length++; | 225 | 10.0k | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 10.0k | return new (p) Type (std::forward<T> (v)); | 227 | 10.3k | } |
hb_serialize_context_t::object_t** hb_vector_t<hb_serialize_context_t::object_t*, false>::push<hb_serialize_context_t::object_t*&, hb_serialize_context_t::object_t*, (void*)0>(hb_serialize_context_t::object_t*&) Line | Count | Source | 216 | 115k | { | 217 | 115k | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 250 | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 114k | length++; | 225 | 114k | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 114k | return new (p) Type (std::forward<T> (v)); | 227 | 115k | } |
Unexecuted instantiation: hb_serialize_context_t::object_t::link_t* hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::push<hb_serialize_context_t::object_t::link_t const&, hb_serialize_context_t::object_t::link_t, (void*)0>(hb_serialize_context_t::object_t::link_t const&) unsigned int* hb_vector_t<unsigned int, false>::push<unsigned int&, unsigned int, (void*)0>(unsigned int&) Line | Count | Source | 216 | 1.46k | { | 217 | 1.46k | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 48 | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 1.41k | length++; | 225 | 1.41k | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 1.41k | return new (p) Type (std::forward<T> (v)); | 227 | 1.46k | } |
Unexecuted instantiation: unsigned int* hb_vector_t<unsigned int, true>::push<unsigned int const&, unsigned int, (void*)0>(unsigned int const&) hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t** hb_vector_t<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, false>::push<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*&, hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, (void*)0>(hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*&) Line | Count | Source | 216 | 12.5k | { | 217 | 12.5k | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 0 | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 12.5k | length++; | 225 | 12.5k | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 12.5k | return new (p) Type (std::forward<T> (v)); | 227 | 12.5k | } |
Unexecuted instantiation: hb_pair_t<unsigned int, unsigned int>* hb_vector_t<hb_pair_t<unsigned int, unsigned int>, true>::push<hb_pair_t<unsigned int&, unsigned int&>, hb_pair_t<unsigned int, unsigned int>, (void*)0>(hb_pair_t<unsigned int&, unsigned int&>&&) Unexecuted instantiation: unsigned int* hb_vector_t<unsigned int, false>::push<unsigned int, unsigned int, (void*)0>(unsigned int&&) Unexecuted instantiation: unsigned int* hb_vector_t<unsigned int, true>::push<unsigned int, unsigned int, (void*)0>(unsigned int&&) Unexecuted instantiation: hb_aat_map_builder_t::feature_info_t* hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::push<hb_aat_map_builder_t::feature_info_t&, hb_aat_map_builder_t::feature_info_t, (void*)0>(hb_aat_map_builder_t::feature_info_t&) Unexecuted instantiation: hb_pair_t<unsigned int, unsigned int>* hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::push<hb_pair_t<unsigned int, unsigned int>&, hb_pair_t<unsigned int, unsigned int>, (void*)0>(hb_pair_t<unsigned int, unsigned int>&) Unexecuted instantiation: hb_pair_t<unsigned int, unsigned int>* hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::push<hb_pair_t<unsigned int, unsigned int> const&, hb_pair_t<unsigned int, unsigned int>, (void*)0>(hb_pair_t<unsigned int, unsigned int> const&) hb_transform_t* hb_vector_t<hb_transform_t, false>::push<hb_transform_t, hb_transform_t, (void*)0>(hb_transform_t&&) Line | Count | Source | 216 | 19.3k | { | 217 | 19.3k | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 187 | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 19.1k | length++; | 225 | 19.1k | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 19.1k | return new (p) Type (std::forward<T> (v)); | 227 | 19.3k | } |
hb_bounds_t* hb_vector_t<hb_bounds_t, false>::push<hb_bounds_t, hb_bounds_t, (void*)0>(hb_bounds_t&&) Line | Count | Source | 216 | 4.11M | { | 217 | 4.11M | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 1.06k | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 4.11M | length++; | 225 | 4.11M | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 4.11M | return new (p) Type (std::forward<T> (v)); | 227 | 4.11M | } |
hb_transform_t* hb_vector_t<hb_transform_t, false>::push<hb_transform_t&, hb_transform_t, (void*)0>(hb_transform_t&) Line | Count | Source | 216 | 511k | { | 217 | 511k | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 287 | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 510k | length++; | 225 | 510k | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 510k | return new (p) Type (std::forward<T> (v)); | 227 | 511k | } |
Unexecuted instantiation: OT::DeltaSetIndexMap const** hb_vector_t<OT::DeltaSetIndexMap const*, false>::push<OT::DeltaSetIndexMap const*, OT::DeltaSetIndexMap const*, (void*)0>(OT::DeltaSetIndexMap const*&&) Unexecuted instantiation: unsigned char* hb_vector_t<unsigned char, false>::push<unsigned char&, unsigned char, (void*)0>(unsigned char&) int* hb_vector_t<int, false>::push<int&, int, (void*)0>(int&) Line | Count | Source | 216 | 21.9M | { | 217 | 21.9M | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 19 | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 21.9M | length++; | 225 | 21.9M | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 21.9M | return new (p) Type (std::forward<T> (v)); | 227 | 21.9M | } |
Unexecuted instantiation: hb_variation_t* hb_vector_t<hb_variation_t, false>::push<hb_variation_t&, hb_variation_t, (void*)0>(hb_variation_t&) Unexecuted instantiation: hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>* hb_vector_t<hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, false>::push<hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, (void*)0>(hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>&&) Unexecuted instantiation: unsigned int* hb_vector_t<unsigned int, false>::push<OT::IntType<unsigned short, 2u> const&, unsigned int, (void*)0>(OT::IntType<unsigned short, 2u> const&) Unexecuted instantiation: OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>** hb_vector_t<OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*, false>::push<OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*&, OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*, (void*)0>(OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*&) Unexecuted instantiation: unsigned int* hb_vector_t<unsigned int, false>::push<OT::IntType<unsigned char, 1u> const&, unsigned int, (void*)0>(OT::IntType<unsigned char, 1u> const&) CFF::cff1_top_dict_val_t* hb_vector_t<CFF::cff1_top_dict_val_t, false>::push<CFF::cff1_top_dict_val_t const&, CFF::cff1_top_dict_val_t, (void*)0>(CFF::cff1_top_dict_val_t const&) Line | Count | Source | 216 | 339k | { | 217 | 339k | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 1.10k | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 338k | length++; | 225 | 338k | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 338k | return new (p) Type (std::forward<T> (v)); | 227 | 339k | } |
CFF::op_str_t* hb_vector_t<CFF::op_str_t, false>::push<CFF::op_str_t const&, CFF::op_str_t, (void*)0>(CFF::op_str_t const&) Line | Count | Source | 216 | 749k | { | 217 | 749k | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 1.89k | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 747k | length++; | 225 | 747k | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 747k | return new (p) Type (std::forward<T> (v)); | 227 | 749k | } |
CFF::dict_val_t* hb_vector_t<CFF::dict_val_t, false>::push<CFF::dict_val_t const&, CFF::dict_val_t, (void*)0>(CFF::dict_val_t const&) Line | Count | Source | 216 | 2.59M | { | 217 | 2.59M | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 5.74k | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 2.58M | length++; | 225 | 2.58M | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 2.58M | return new (p) Type (std::forward<T> (v)); | 227 | 2.59M | } |
OT::cff1::accelerator_t::gname_t* hb_vector_t<OT::cff1::accelerator_t::gname_t, true>::push<OT::cff1::accelerator_t::gname_t&, OT::cff1::accelerator_t::gname_t, (void*)0>(OT::cff1::accelerator_t::gname_t&) Line | Count | Source | 216 | 8.31M | { | 217 | 8.31M | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 0 | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 8.31M | length++; | 225 | 8.31M | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 8.31M | return new (p) Type (std::forward<T> (v)); | 227 | 8.31M | } |
Unexecuted instantiation: hb_ot_name_record_ids_t* hb_vector_t<hb_ot_name_record_ids_t, false>::push<hb_ot_name_record_ids_t const&, hb_ot_name_record_ids_t, (void*)0>(hb_ot_name_record_ids_t const&) unsigned int* hb_vector_t<unsigned int, false>::push<long, unsigned int, (void*)0>(long&&) Line | Count | Source | 216 | 16.9M | { | 217 | 16.9M | if (unlikely (!alloc (length + 1))) | 218 | | // If push failed to allocate then don't copy v, since this may cause | 219 | | // the created copy to leak memory since we won't have stored a | 220 | | // reference to it. | 221 | 340k | return &Crap (Type); | 222 | | | 223 | | /* Emplace. */ | 224 | 16.6M | length++; | 225 | 16.6M | Type *p = std::addressof (arrayZ[length - 1]); | 226 | 16.6M | return new (p) Type (std::forward<T> (v)); | 227 | 16.9M | } |
Unexecuted instantiation: unsigned int* hb_vector_t<unsigned int, true>::push<unsigned int&, unsigned int, (void*)0>(unsigned int&) |
228 | | |
229 | 115M | bool in_error () const { return allocated < 0; } hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::in_error() const Line | Count | Source | 229 | 263k | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_aat_map_t::range_flags_t, true>::in_error() const Line | Count | Source | 229 | 329k | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::in_error() const Line | Count | Source | 229 | 600k | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_bit_page_t, false>::in_error() const Line | Count | Source | 229 | 8.54M | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_bit_set_t::page_map_t, true>::in_error() const Line | Count | Source | 229 | 8.53M | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_serialize_context_t::object_t*, false>::in_error() const Line | Count | Source | 229 | 266k | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::in_error() const Line | Count | Source | 229 | 328k | bool in_error () const { return allocated < 0; } |
hb_vector_t<unsigned int, false>::in_error() const Line | Count | Source | 229 | 17.2M | bool in_error () const { return allocated < 0; } |
Unexecuted instantiation: hb_vector_t<hb_vector_t<unsigned int, false>, false>::in_error() const Unexecuted instantiation: hb_vector_t<unsigned int, true>::in_error() const hb_vector_t<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, false>::in_error() const Line | Count | Source | 229 | 35.8k | bool in_error () const { return allocated < 0; } |
Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, true>::in_error() const Unexecuted instantiation: hb_vector_t<OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t, false>::in_error() const Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::in_error() const Unexecuted instantiation: hb_vector_t<hb_set_t, false>::in_error() const hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::in_error() const Line | Count | Source | 229 | 5.16M | bool in_error () const { return allocated < 0; } |
Unexecuted instantiation: hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::in_error() const hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::in_error() const Line | Count | Source | 229 | 296k | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::in_error() const Line | Count | Source | 229 | 587k | bool in_error () const { return allocated < 0; } |
Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::in_error() const hb_vector_t<hb_transform_t, false>::in_error() const Line | Count | Source | 229 | 552k | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_bounds_t, false>::in_error() const Line | Count | Source | 229 | 4.16M | bool in_error () const { return allocated < 0; } |
Unexecuted instantiation: hb_vector_t<OT::LayerRecord, false>::in_error() const Unexecuted instantiation: hb_vector_t<OT::index_map_subset_plan_t, false>::in_error() const Unexecuted instantiation: hb_vector_t<hb_set_t*, false>::in_error() const Unexecuted instantiation: hb_vector_t<OT::DeltaSetIndexMap const*, false>::in_error() const hb_vector_t<OT::contour_point_t, false>::in_error() const Line | Count | Source | 229 | 4.96M | bool in_error () const { return allocated < 0; } |
hb_vector_t<int, false>::in_error() const Line | Count | Source | 229 | 22.2M | bool in_error () const { return allocated < 0; } |
Unexecuted instantiation: hb_vector_t<unsigned char, false>::in_error() const Unexecuted instantiation: hb_vector_t<OT::glyf_impl::SubsetGlyph, false>::in_error() const Unexecuted instantiation: hb_vector_t<hb_variation_t, false>::in_error() const hb_vector_t<char, false>::in_error() const Line | Count | Source | 229 | 5.67k | bool in_error () const { return allocated < 0; } |
Unexecuted instantiation: hb_vector_t<OT::IndexSubtableRecord, false>::in_error() const Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, false>::in_error() const Unexecuted instantiation: hb_vector_t<OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*, false>::in_error() const Unexecuted instantiation: hb_vector_t<hb_array_t<unsigned char const>, false>::in_error() const hb_vector_t<CFF::cff1_top_dict_val_t, false>::in_error() const Line | Count | Source | 229 | 401k | bool in_error () const { return allocated < 0; } |
hb_vector_t<CFF::op_str_t, false>::in_error() const Line | Count | Source | 229 | 1.12M | bool in_error () const { return allocated < 0; } |
hb_vector_t<CFF::dict_val_t, false>::in_error() const Line | Count | Source | 229 | 2.98M | bool in_error () const { return allocated < 0; } |
hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::in_error() const Line | Count | Source | 229 | 52.9k | bool in_error () const { return allocated < 0; } |
hb_vector_t<CFF::cff1_font_dict_values_t, false>::in_error() const Line | Count | Source | 229 | 710k | bool in_error () const { return allocated < 0; } |
hb_vector_t<OT::cff1::accelerator_t::gname_t, true>::in_error() const Line | Count | Source | 229 | 8.41M | bool in_error () const { return allocated < 0; } |
hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::in_error() const Line | Count | Source | 229 | 24.8k | bool in_error () const { return allocated < 0; } |
hb_vector_t<CFF::cff2_font_dict_values_t, false>::in_error() const Line | Count | Source | 229 | 39.5k | bool in_error () const { return allocated < 0; } |
Unexecuted instantiation: hb_vector_t<hb_ot_name_record_ids_t, false>::in_error() const hb_vector_t<hb_ot_name_entry_t, false>::in_error() const Line | Count | Source | 229 | 6.09M | bool in_error () const { return allocated < 0; } |
hb_vector_t<float, false>::in_error() const Line | Count | Source | 229 | 374 | bool in_error () const { return allocated < 0; } |
Unexecuted instantiation: hb_vector_t<CFF::number_t, false>::in_error() const hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::in_error() const Line | Count | Source | 229 | 9.24M | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::in_error() const Line | Count | Source | 229 | 7.81M | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::in_error() const Line | Count | Source | 229 | 1.93M | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_ot_map_t::feature_map_t, true>::in_error() const Line | Count | Source | 229 | 1.10M | bool in_error () const { return allocated < 0; } |
hb_vector_t<hb_ot_map_t::stage_map_t, false>::in_error() const Line | Count | Source | 229 | 1.91M | bool in_error () const { return allocated < 0; } |
|
230 | | |
231 | | template <typename T = Type, |
232 | | hb_enable_if (hb_is_trivially_copy_assignable(T))> |
233 | | Type * |
234 | | realloc_vector (unsigned new_allocated) |
235 | 7.37M | { |
236 | 7.37M | if (!new_allocated) |
237 | 0 | { |
238 | 0 | hb_free (arrayZ); |
239 | 0 | return nullptr; |
240 | 0 | } |
241 | 7.37M | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); |
242 | 7.37M | } hb_aat_map_t::range_flags_t* hb_vector_t<hb_aat_map_t::range_flags_t, true>::realloc_vector<hb_aat_map_t::range_flags_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 164k | { | 236 | 164k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 164k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 164k | } |
hb_user_data_array_t::hb_user_data_item_t* hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::realloc_vector<hb_user_data_array_t::hb_user_data_item_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 198k | { | 236 | 198k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 198k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 198k | } |
hb_bit_page_t* hb_vector_t<hb_bit_page_t, false>::realloc_vector<hb_bit_page_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 440k | { | 236 | 440k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 440k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 440k | } |
hb_bit_set_t::page_map_t* hb_vector_t<hb_bit_set_t::page_map_t, true>::realloc_vector<hb_bit_set_t::page_map_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 438k | { | 236 | 438k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 438k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 438k | } |
hb_serialize_context_t::object_t::link_t* hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::realloc_vector<hb_serialize_context_t::object_t::link_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 49.9k | { | 236 | 49.9k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 49.9k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 49.9k | } |
hb_serialize_context_t::object_t** hb_vector_t<hb_serialize_context_t::object_t*, false>::realloc_vector<hb_serialize_context_t::object_t*, (void*)0>(unsigned int) Line | Count | Source | 235 | 15.5k | { | 236 | 15.5k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 15.5k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 15.5k | } |
unsigned int* hb_vector_t<unsigned int, false>::realloc_vector<unsigned int, (void*)0>(unsigned int) Line | Count | Source | 235 | 117k | { | 236 | 117k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 117k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 117k | } |
Unexecuted instantiation: unsigned int* hb_vector_t<unsigned int, true>::realloc_vector<unsigned int, (void*)0>(unsigned int) hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t** hb_vector_t<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, false>::realloc_vector<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, (void*)0>(unsigned int) Line | Count | Source | 235 | 10.3k | { | 236 | 10.3k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 10.3k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 10.3k | } |
Unexecuted instantiation: hb_pair_t<unsigned int, unsigned int>* hb_vector_t<hb_pair_t<unsigned int, unsigned int>, true>::realloc_vector<hb_pair_t<unsigned int, unsigned int>, (void*)0>(unsigned int) Unexecuted instantiation: OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t* hb_vector_t<OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t, false>::realloc_vector<OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t, (void*)0>(unsigned int) OT::hb_accelerate_subtables_context_t::hb_applicable_t* hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::realloc_vector<OT::hb_accelerate_subtables_context_t::hb_applicable_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 1.25M | { | 236 | 1.25M | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 1.25M | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 1.25M | } |
Unexecuted instantiation: hb_aat_map_builder_t::feature_range_t* hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::realloc_vector<hb_aat_map_builder_t::feature_range_t, (void*)0>(unsigned int) hb_aat_map_builder_t::feature_event_t* hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::realloc_vector<hb_aat_map_builder_t::feature_event_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 148k | { | 236 | 148k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 148k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 148k | } |
Unexecuted instantiation: hb_aat_map_builder_t::feature_info_t* hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::realloc_vector<hb_aat_map_builder_t::feature_info_t, (void*)0>(unsigned int) Unexecuted instantiation: hb_pair_t<unsigned int, unsigned int>* hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::realloc_vector<hb_pair_t<unsigned int, unsigned int>, (void*)0>(unsigned int) hb_transform_t* hb_vector_t<hb_transform_t, false>::realloc_vector<hb_transform_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 21.9k | { | 236 | 21.9k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 21.9k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 21.9k | } |
hb_bounds_t* hb_vector_t<hb_bounds_t, false>::realloc_vector<hb_bounds_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 42.6k | { | 236 | 42.6k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 42.6k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 42.6k | } |
Unexecuted instantiation: OT::LayerRecord* hb_vector_t<OT::LayerRecord, false>::realloc_vector<OT::LayerRecord, (void*)0>(unsigned int) Unexecuted instantiation: hb_set_t** hb_vector_t<hb_set_t*, false>::realloc_vector<hb_set_t*, (void*)0>(unsigned int) Unexecuted instantiation: OT::DeltaSetIndexMap const** hb_vector_t<OT::DeltaSetIndexMap const*, false>::realloc_vector<OT::DeltaSetIndexMap const*, (void*)0>(unsigned int) int* hb_vector_t<int, false>::realloc_vector<int, (void*)0>(unsigned int) Line | Count | Source | 235 | 126k | { | 236 | 126k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 126k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 126k | } |
OT::contour_point_t* hb_vector_t<OT::contour_point_t, false>::realloc_vector<OT::contour_point_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 523k | { | 236 | 523k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 523k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 523k | } |
Unexecuted instantiation: unsigned char* hb_vector_t<unsigned char, false>::realloc_vector<unsigned char, (void*)0>(unsigned int) Unexecuted instantiation: OT::glyf_impl::SubsetGlyph* hb_vector_t<OT::glyf_impl::SubsetGlyph, false>::realloc_vector<OT::glyf_impl::SubsetGlyph, (void*)0>(unsigned int) Unexecuted instantiation: hb_variation_t* hb_vector_t<hb_variation_t, false>::realloc_vector<hb_variation_t, (void*)0>(unsigned int) char* hb_vector_t<char, false>::realloc_vector<char, (void*)0>(unsigned int) Line | Count | Source | 235 | 2.83k | { | 236 | 2.83k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 2.83k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 2.83k | } |
Unexecuted instantiation: hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>* hb_vector_t<hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, false>::realloc_vector<hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, (void*)0>(unsigned int) Unexecuted instantiation: OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>** hb_vector_t<OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*, false>::realloc_vector<OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*, (void*)0>(unsigned int) Unexecuted instantiation: hb_array_t<unsigned char const>* hb_vector_t<hb_array_t<unsigned char const>, false>::realloc_vector<hb_array_t<unsigned char const>, (void*)0>(unsigned int) CFF::cff1_top_dict_val_t* hb_vector_t<CFF::cff1_top_dict_val_t, false>::realloc_vector<CFF::cff1_top_dict_val_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 62.0k | { | 236 | 62.0k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 62.0k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 62.0k | } |
CFF::op_str_t* hb_vector_t<CFF::op_str_t, false>::realloc_vector<CFF::op_str_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 370k | { | 236 | 370k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 370k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 370k | } |
CFF::dict_val_t* hb_vector_t<CFF::dict_val_t, false>::realloc_vector<CFF::dict_val_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 398k | { | 236 | 398k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 398k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 398k | } |
OT::cff1::accelerator_t::gname_t* hb_vector_t<OT::cff1::accelerator_t::gname_t, true>::realloc_vector<OT::cff1::accelerator_t::gname_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 106k | { | 236 | 106k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 106k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 106k | } |
Unexecuted instantiation: hb_ot_name_record_ids_t* hb_vector_t<hb_ot_name_record_ids_t, false>::realloc_vector<hb_ot_name_record_ids_t, (void*)0>(unsigned int) hb_ot_name_entry_t* hb_vector_t<hb_ot_name_entry_t, false>::realloc_vector<hb_ot_name_entry_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 74.6k | { | 236 | 74.6k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 74.6k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 74.6k | } |
float* hb_vector_t<float, false>::realloc_vector<float, (void*)0>(unsigned int) Line | Count | Source | 235 | 171 | { | 236 | 171 | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 171 | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 171 | } |
Unexecuted instantiation: CFF::number_t* hb_vector_t<CFF::number_t, false>::realloc_vector<CFF::number_t, (void*)0>(unsigned int) hb_ot_map_builder_t::feature_info_t* hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::realloc_vector<hb_ot_map_builder_t::feature_info_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 910k | { | 236 | 910k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 910k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 910k | } |
hb_ot_map_t::lookup_map_t* hb_vector_t<hb_ot_map_t::lookup_map_t, false>::realloc_vector<hb_ot_map_t::lookup_map_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 348k | { | 236 | 348k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 348k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 348k | } |
hb_ot_map_builder_t::stage_info_t* hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::realloc_vector<hb_ot_map_builder_t::stage_info_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 622k | { | 236 | 622k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 622k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 622k | } |
hb_ot_map_t::feature_map_t* hb_vector_t<hb_ot_map_t::feature_map_t, true>::realloc_vector<hb_ot_map_t::feature_map_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 301k | { | 236 | 301k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 301k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 301k | } |
hb_ot_map_t::stage_map_t* hb_vector_t<hb_ot_map_t::stage_map_t, false>::realloc_vector<hb_ot_map_t::stage_map_t, (void*)0>(unsigned int) Line | Count | Source | 235 | 618k | { | 236 | 618k | if (!new_allocated) | 237 | 0 | { | 238 | 0 | hb_free (arrayZ); | 239 | 0 | return nullptr; | 240 | 0 | } | 241 | 618k | return (Type *) hb_realloc (arrayZ, new_allocated * sizeof (Type)); | 242 | 618k | } |
|
243 | | template <typename T = Type, |
244 | | hb_enable_if (!hb_is_trivially_copy_assignable(T))> |
245 | | Type * |
246 | | realloc_vector (unsigned new_allocated) |
247 | 181k | { |
248 | 181k | if (!new_allocated) |
249 | 0 | { |
250 | 0 | hb_free (arrayZ); |
251 | 0 | return nullptr; |
252 | 0 | } |
253 | 181k | Type *new_array = (Type *) hb_malloc (new_allocated * sizeof (Type)); |
254 | 181k | if (likely (new_array)) |
255 | 180k | { |
256 | 1.03M | for (unsigned i = 0; i < length; i++) |
257 | 853k | { |
258 | 853k | new (std::addressof (new_array[i])) Type (); |
259 | 853k | new_array[i] = std::move (arrayZ[i]); |
260 | 853k | arrayZ[i].~Type (); |
261 | 853k | } |
262 | 180k | hb_free (arrayZ); |
263 | 180k | } |
264 | 181k | return new_array; |
265 | 181k | } hb_vector_t<hb_aat_map_t::range_flags_t, true>* hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::realloc_vector<hb_vector_t<hb_aat_map_t::range_flags_t, true>, (void*)0>(unsigned int) Line | Count | Source | 247 | 117k | { | 248 | 117k | if (!new_allocated) | 249 | 0 | { | 250 | 0 | hb_free (arrayZ); | 251 | 0 | return nullptr; | 252 | 0 | } | 253 | 117k | Type *new_array = (Type *) hb_malloc (new_allocated * sizeof (Type)); | 254 | 117k | if (likely (new_array)) | 255 | 115k | { | 256 | 115k | for (unsigned i = 0; i < length; i++) | 257 | 0 | { | 258 | 0 | new (std::addressof (new_array[i])) Type (); | 259 | 0 | new_array[i] = std::move (arrayZ[i]); | 260 | 0 | arrayZ[i].~Type (); | 261 | 0 | } | 262 | 115k | hb_free (arrayZ); | 263 | 115k | } | 264 | 117k | return new_array; | 265 | 117k | } |
Unexecuted instantiation: hb_vector_t<unsigned int, false>* hb_vector_t<hb_vector_t<unsigned int, false>, false>::realloc_vector<hb_vector_t<unsigned int, false>, (void*)0>(unsigned int) Unexecuted instantiation: hb_inc_bimap_t* hb_vector_t<hb_inc_bimap_t, false>::realloc_vector<hb_inc_bimap_t, (void*)0>(unsigned int) Unexecuted instantiation: hb_set_t* hb_vector_t<hb_set_t, false>::realloc_vector<hb_set_t, (void*)0>(unsigned int) Unexecuted instantiation: OT::index_map_subset_plan_t* hb_vector_t<OT::index_map_subset_plan_t, false>::realloc_vector<OT::index_map_subset_plan_t, (void*)0>(unsigned int) Unexecuted instantiation: OT::IndexSubtableRecord* hb_vector_t<OT::IndexSubtableRecord, false>::realloc_vector<OT::IndexSubtableRecord, (void*)0>(unsigned int) CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>* hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::realloc_vector<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, (void*)0>(unsigned int) Line | Count | Source | 247 | 26.4k | { | 248 | 26.4k | if (!new_allocated) | 249 | 0 | { | 250 | 0 | hb_free (arrayZ); | 251 | 0 | return nullptr; | 252 | 0 | } | 253 | 26.4k | Type *new_array = (Type *) hb_malloc (new_allocated * sizeof (Type)); | 254 | 26.4k | if (likely (new_array)) | 255 | 26.4k | { | 256 | 26.4k | for (unsigned i = 0; i < length; i++) | 257 | 0 | { | 258 | 0 | new (std::addressof (new_array[i])) Type (); | 259 | 0 | new_array[i] = std::move (arrayZ[i]); | 260 | 0 | arrayZ[i].~Type (); | 261 | 0 | } | 262 | 26.4k | hb_free (arrayZ); | 263 | 26.4k | } | 264 | 26.4k | return new_array; | 265 | 26.4k | } |
CFF::cff1_font_dict_values_t* hb_vector_t<CFF::cff1_font_dict_values_t, false>::realloc_vector<CFF::cff1_font_dict_values_t, (void*)0>(unsigned int) Line | Count | Source | 247 | 13.8k | { | 248 | 13.8k | if (!new_allocated) | 249 | 0 | { | 250 | 0 | hb_free (arrayZ); | 251 | 0 | return nullptr; | 252 | 0 | } | 253 | 13.8k | Type *new_array = (Type *) hb_malloc (new_allocated * sizeof (Type)); | 254 | 13.8k | if (likely (new_array)) | 255 | 13.7k | { | 256 | 839k | for (unsigned i = 0; i < length; i++) | 257 | 825k | { | 258 | 825k | new (std::addressof (new_array[i])) Type (); | 259 | 825k | new_array[i] = std::move (arrayZ[i]); | 260 | 825k | arrayZ[i].~Type (); | 261 | 825k | } | 262 | 13.7k | hb_free (arrayZ); | 263 | 13.7k | } | 264 | 13.8k | return new_array; | 265 | 13.8k | } |
CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>* hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::realloc_vector<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, (void*)0>(unsigned int) Line | Count | Source | 247 | 12.0k | { | 248 | 12.0k | if (!new_allocated) | 249 | 0 | { | 250 | 0 | hb_free (arrayZ); | 251 | 0 | return nullptr; | 252 | 0 | } | 253 | 12.0k | Type *new_array = (Type *) hb_malloc (new_allocated * sizeof (Type)); | 254 | 12.0k | if (likely (new_array)) | 255 | 12.0k | { | 256 | 12.0k | for (unsigned i = 0; i < length; i++) | 257 | 0 | { | 258 | 0 | new (std::addressof (new_array[i])) Type (); | 259 | 0 | new_array[i] = std::move (arrayZ[i]); | 260 | 0 | arrayZ[i].~Type (); | 261 | 0 | } | 262 | 12.0k | hb_free (arrayZ); | 263 | 12.0k | } | 264 | 12.0k | return new_array; | 265 | 12.0k | } |
CFF::cff2_font_dict_values_t* hb_vector_t<CFF::cff2_font_dict_values_t, false>::realloc_vector<CFF::cff2_font_dict_values_t, (void*)0>(unsigned int) Line | Count | Source | 247 | 12.2k | { | 248 | 12.2k | if (!new_allocated) | 249 | 0 | { | 250 | 0 | hb_free (arrayZ); | 251 | 0 | return nullptr; | 252 | 0 | } | 253 | 12.2k | Type *new_array = (Type *) hb_malloc (new_allocated * sizeof (Type)); | 254 | 12.2k | if (likely (new_array)) | 255 | 12.2k | { | 256 | 39.8k | for (unsigned i = 0; i < length; i++) | 257 | 27.6k | { | 258 | 27.6k | new (std::addressof (new_array[i])) Type (); | 259 | 27.6k | new_array[i] = std::move (arrayZ[i]); | 260 | 27.6k | arrayZ[i].~Type (); | 261 | 27.6k | } | 262 | 12.2k | hb_free (arrayZ); | 263 | 12.2k | } | 264 | 12.2k | return new_array; | 265 | 12.2k | } |
|
266 | | |
267 | | template <typename T = Type, |
268 | | hb_enable_if (hb_is_trivially_constructible(T))> |
269 | | void |
270 | | grow_vector (unsigned size) |
271 | 43.3M | { |
272 | 43.3M | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); |
273 | 43.3M | length = size; |
274 | 43.3M | } void hb_vector_t<hb_bit_page_t, false>::grow_vector<hb_bit_page_t, (void*)0>(unsigned int) Line | Count | Source | 271 | 8.04M | { | 272 | 8.04M | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 8.04M | length = size; | 274 | 8.04M | } |
void hb_vector_t<hb_bit_set_t::page_map_t, true>::grow_vector<hb_bit_set_t::page_map_t, (void*)0>(unsigned int) Line | Count | Source | 271 | 8.04M | { | 272 | 8.04M | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 8.04M | length = size; | 274 | 8.04M | } |
void hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::grow_vector<hb_serialize_context_t::object_t::link_t, (void*)0>(unsigned int) Line | Count | Source | 271 | 138k | { | 272 | 138k | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 138k | length = size; | 274 | 138k | } |
void hb_vector_t<unsigned int, false>::grow_vector<unsigned int, (void*)0>(unsigned int) Line | Count | Source | 271 | 52.3k | { | 272 | 52.3k | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 52.3k | length = size; | 274 | 52.3k | } |
Unexecuted instantiation: void hb_vector_t<OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t, false>::grow_vector<OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t, (void*)0>(unsigned int) Unexecuted instantiation: void hb_vector_t<unsigned int, true>::grow_vector<unsigned int, (void*)0>(unsigned int) void hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::grow_vector<OT::hb_accelerate_subtables_context_t::hb_applicable_t, (void*)0>(unsigned int) Line | Count | Source | 271 | 2.30M | { | 272 | 2.30M | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 2.30M | length = size; | 274 | 2.30M | } |
Unexecuted instantiation: void hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::grow_vector<hb_aat_map_builder_t::feature_range_t, (void*)0>(unsigned int) void hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::grow_vector<hb_aat_map_builder_t::feature_event_t, (void*)0>(unsigned int) Line | Count | Source | 271 | 146k | { | 272 | 146k | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 146k | length = size; | 274 | 146k | } |
Unexecuted instantiation: void hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::grow_vector<hb_aat_map_builder_t::feature_info_t, (void*)0>(unsigned int) Unexecuted instantiation: void hb_vector_t<OT::LayerRecord, false>::grow_vector<OT::LayerRecord, (void*)0>(unsigned int) Unexecuted instantiation: void hb_vector_t<hb_set_t*, false>::grow_vector<hb_set_t*, (void*)0>(unsigned int) void hb_vector_t<int, false>::grow_vector<int, (void*)0>(unsigned int) Line | Count | Source | 271 | 84.4k | { | 272 | 84.4k | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 84.4k | length = size; | 274 | 84.4k | } |
Unexecuted instantiation: void hb_vector_t<OT::IndexSubtableRecord, false>::grow_vector<OT::IndexSubtableRecord, (void*)0>(unsigned int) void hb_vector_t<hb_ot_name_entry_t, false>::grow_vector<hb_ot_name_entry_t, (void*)0>(unsigned int) Line | Count | Source | 271 | 5.61M | { | 272 | 5.61M | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 5.61M | length = size; | 274 | 5.61M | } |
void hb_vector_t<char, false>::grow_vector<char, (void*)0>(unsigned int) Line | Count | Source | 271 | 2.68k | { | 272 | 2.68k | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 2.68k | length = size; | 274 | 2.68k | } |
void hb_vector_t<float, false>::grow_vector<float, (void*)0>(unsigned int) Line | Count | Source | 271 | 163 | { | 272 | 163 | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 163 | length = size; | 274 | 163 | } |
void hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::grow_vector<hb_ot_map_builder_t::feature_info_t, (void*)0>(unsigned int) Line | Count | Source | 271 | 8.19M | { | 272 | 8.19M | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 8.19M | length = size; | 274 | 8.19M | } |
void hb_vector_t<hb_ot_map_t::lookup_map_t, false>::grow_vector<hb_ot_map_t::lookup_map_t, (void*)0>(unsigned int) Line | Count | Source | 271 | 7.33M | { | 272 | 7.33M | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 7.33M | length = size; | 274 | 7.33M | } |
void hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::grow_vector<hb_ot_map_builder_t::stage_info_t, (void*)0>(unsigned int) Line | Count | Source | 271 | 1.29M | { | 272 | 1.29M | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 1.29M | length = size; | 274 | 1.29M | } |
void hb_vector_t<hb_ot_map_t::feature_map_t, true>::grow_vector<hb_ot_map_t::feature_map_t, (void*)0>(unsigned int) Line | Count | Source | 271 | 803k | { | 272 | 803k | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 803k | length = size; | 274 | 803k | } |
void hb_vector_t<hb_ot_map_t::stage_map_t, false>::grow_vector<hb_ot_map_t::stage_map_t, (void*)0>(unsigned int) Line | Count | Source | 271 | 1.29M | { | 272 | 1.29M | memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); | 273 | 1.29M | length = size; | 274 | 1.29M | } |
|
275 | | template <typename T = Type, |
276 | | hb_enable_if (!hb_is_trivially_constructible(T))> |
277 | | void |
278 | | grow_vector (unsigned size) |
279 | 1.12M | { |
280 | 130M | while (length < size) |
281 | 129M | { |
282 | 129M | length++; |
283 | 129M | new (std::addressof (arrayZ[length - 1])) Type (); |
284 | 129M | } |
285 | 1.12M | } void hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::grow_vector<hb_vector_t<hb_aat_map_t::range_flags_t, true>, (void*)0>(unsigned int) Line | Count | Source | 279 | 115k | { | 280 | 280k | while (length < size) | 281 | 164k | { | 282 | 164k | length++; | 283 | 164k | new (std::addressof (arrayZ[length - 1])) Type (); | 284 | 164k | } | 285 | 115k | } |
Unexecuted instantiation: void hb_vector_t<hb_vector_t<unsigned int, false>, false>::grow_vector<hb_vector_t<unsigned int, false>, (void*)0>(unsigned int) Unexecuted instantiation: void hb_vector_t<hb_inc_bimap_t, false>::grow_vector<hb_inc_bimap_t, (void*)0>(unsigned int) Unexecuted instantiation: void hb_vector_t<hb_set_t, false>::grow_vector<hb_set_t, (void*)0>(unsigned int) Unexecuted instantiation: void hb_vector_t<OT::index_map_subset_plan_t, false>::grow_vector<OT::index_map_subset_plan_t, (void*)0>(unsigned int) void hb_vector_t<OT::contour_point_t, false>::grow_vector<OT::contour_point_t, (void*)0>(unsigned int) Line | Count | Source | 279 | 596k | { | 280 | 128M | while (length < size) | 281 | 127M | { | 282 | 127M | length++; | 283 | 127M | new (std::addressof (arrayZ[length - 1])) Type (); | 284 | 127M | } | 285 | 596k | } |
Unexecuted instantiation: void hb_vector_t<OT::glyf_impl::SubsetGlyph, false>::grow_vector<OT::glyf_impl::SubsetGlyph, (void*)0>(unsigned int) Unexecuted instantiation: void hb_vector_t<hb_array_t<unsigned char const>, false>::grow_vector<hb_array_t<unsigned char const>, (void*)0>(unsigned int) void hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::grow_vector<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, (void*)0>(unsigned int) Line | Count | Source | 279 | 26.4k | { | 280 | 582k | while (length < size) | 281 | 556k | { | 282 | 556k | length++; | 283 | 556k | new (std::addressof (arrayZ[length - 1])) Type (); | 284 | 556k | } | 285 | 26.4k | } |
void hb_vector_t<CFF::cff1_font_dict_values_t, false>::grow_vector<CFF::cff1_font_dict_values_t, (void*)0>(unsigned int) Line | Count | Source | 279 | 348k | { | 280 | 696k | while (length < size) | 281 | 348k | { | 282 | 348k | length++; | 283 | 348k | new (std::addressof (arrayZ[length - 1])) Type (); | 284 | 348k | } | 285 | 348k | } |
void hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::grow_vector<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, (void*)0>(unsigned int) Line | Count | Source | 279 | 12.0k | { | 280 | 398k | while (length < size) | 281 | 385k | { | 282 | 385k | length++; | 283 | 385k | new (std::addressof (arrayZ[length - 1])) Type (); | 284 | 385k | } | 285 | 12.0k | } |
void hb_vector_t<CFF::cff2_font_dict_values_t, false>::grow_vector<CFF::cff2_font_dict_values_t, (void*)0>(unsigned int) Line | Count | Source | 279 | 27.1k | { | 280 | 54.3k | while (length < size) | 281 | 27.1k | { | 282 | 27.1k | length++; | 283 | 27.1k | new (std::addressof (arrayZ[length - 1])) Type (); | 284 | 27.1k | } | 285 | 27.1k | } |
Unexecuted instantiation: void hb_vector_t<CFF::number_t, false>::grow_vector<CFF::number_t, (void*)0>(unsigned int) |
286 | | |
287 | | template <typename T = Type, |
288 | | hb_enable_if (hb_is_trivially_copyable (T))> |
289 | | void |
290 | | copy_vector (const hb_vector_t &other) |
291 | 146k | { |
292 | 146k | length = other.length; |
293 | 146k | #ifndef HB_OPTIMIZE_SIZE |
294 | 146k | if (sizeof (T) >= sizeof (long long)) |
295 | | /* This runs faster because of alignment. */ |
296 | 146k | for (unsigned i = 0; i < length; i++) |
297 | 0 | arrayZ[i] = other.arrayZ[i]; |
298 | 0 | else |
299 | 0 | #endif |
300 | 0 | hb_memcpy ((void *) arrayZ, (const void *) other.arrayZ, length * item_size); |
301 | 146k | } Unexecuted instantiation: void hb_vector_t<hb_bit_set_t::page_map_t, true>::copy_vector<hb_bit_set_t::page_map_t, (void*)0>(hb_vector_t<hb_bit_set_t::page_map_t, true> const&) Unexecuted instantiation: void hb_vector_t<hb_bit_page_t, false>::copy_vector<hb_bit_page_t, (void*)0>(hb_vector_t<hb_bit_page_t, false> const&) Unexecuted instantiation: void hb_vector_t<unsigned int, false>::copy_vector<unsigned int, (void*)0>(hb_vector_t<unsigned int, false> const&) void hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::copy_vector<hb_aat_map_builder_t::feature_info_t, (void*)0>(hb_vector_t<hb_aat_map_builder_t::feature_info_t, true> const&) Line | Count | Source | 291 | 146k | { | 292 | 146k | length = other.length; | 293 | 146k | #ifndef HB_OPTIMIZE_SIZE | 294 | 146k | if (sizeof (T) >= sizeof (long long)) | 295 | | /* This runs faster because of alignment. */ | 296 | 146k | for (unsigned i = 0; i < length; i++) | 297 | 0 | arrayZ[i] = other.arrayZ[i]; | 298 | 0 | else | 299 | 0 | #endif | 300 | 0 | hb_memcpy ((void *) arrayZ, (const void *) other.arrayZ, length * item_size); | 301 | 146k | } |
Unexecuted instantiation: void hb_vector_t<OT::LayerRecord, false>::copy_vector<OT::LayerRecord, (void*)0>(hb_vector_t<OT::LayerRecord, false> const&) Unexecuted instantiation: void hb_vector_t<OT::contour_point_t, false>::copy_vector<OT::contour_point_t, (void*)0>(hb_vector_t<OT::contour_point_t, false> const&) |
302 | | template <typename T = Type, |
303 | | hb_enable_if (!hb_is_trivially_copyable (T) && |
304 | | std::is_copy_constructible<T>::value)> |
305 | | void |
306 | | copy_vector (const hb_vector_t &other) |
307 | 0 | { |
308 | 0 | length = 0; |
309 | 0 | while (length < other.length) |
310 | 0 | { |
311 | 0 | length++; |
312 | 0 | new (std::addressof (arrayZ[length - 1])) Type (other.arrayZ[length - 1]); |
313 | 0 | } |
314 | 0 | } |
315 | | template <typename T = Type, |
316 | | hb_enable_if (!hb_is_trivially_copyable (T) && |
317 | | !std::is_copy_constructible<T>::value && |
318 | | std::is_default_constructible<T>::value && |
319 | | std::is_copy_assignable<T>::value)> |
320 | | void |
321 | | copy_vector (const hb_vector_t &other) |
322 | | { |
323 | | length = 0; |
324 | | while (length < other.length) |
325 | | { |
326 | | length++; |
327 | | new (std::addressof (arrayZ[length - 1])) Type (); |
328 | | arrayZ[length - 1] = other.arrayZ[length - 1]; |
329 | | } |
330 | | } |
331 | | |
332 | | void |
333 | | shrink_vector (unsigned size) |
334 | 17.1M | { |
335 | 543M | while ((unsigned) length > size) |
336 | 526M | { |
337 | 526M | arrayZ[(unsigned) length - 1].~Type (); |
338 | 526M | length--; |
339 | 526M | } |
340 | 17.1M | } hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 148k | { | 335 | 313k | while ((unsigned) length > size) | 336 | 164k | { | 337 | 164k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 164k | length--; | 339 | 164k | } | 340 | 148k | } |
hb_vector_t<hb_aat_map_t::range_flags_t, true>::shrink_vector(unsigned int) Line | Count | Source | 334 | 164k | { | 335 | 327k | while ((unsigned) length > size) | 336 | 162k | { | 337 | 162k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 162k | length--; | 339 | 162k | } | 340 | 164k | } |
hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::shrink_vector(unsigned int) Line | Count | Source | 334 | 296k | { | 335 | 296k | while ((unsigned) length > size) | 336 | 0 | { | 337 | 0 | arrayZ[(unsigned) length - 1].~Type (); | 338 | 0 | length--; | 339 | 0 | } | 340 | 296k | } |
hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::shrink_vector(unsigned int) Line | Count | Source | 334 | 148k | { | 335 | 148k | while ((unsigned) length > size) | 336 | 0 | { | 337 | 0 | arrayZ[(unsigned) length - 1].~Type (); | 338 | 0 | length--; | 339 | 0 | } | 340 | 148k | } |
hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 198k | { | 335 | 198k | while ((unsigned) length > size) | 336 | 0 | { | 337 | 0 | arrayZ[(unsigned) length - 1].~Type (); | 338 | 0 | length--; | 339 | 0 | } | 340 | 198k | } |
hb_vector_t<hb_ot_map_t::feature_map_t, true>::shrink_vector(unsigned int) Line | Count | Source | 334 | 588k | { | 335 | 1.39M | while ((unsigned) length > size) | 336 | 803k | { | 337 | 803k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 803k | length--; | 339 | 803k | } | 340 | 588k | } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 1.23M | { | 335 | 8.57M | while ((unsigned) length > size) | 336 | 7.33M | { | 337 | 7.33M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 7.33M | length--; | 339 | 7.33M | } | 340 | 1.23M | } |
hb_vector_t<hb_ot_map_t::stage_map_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 1.17M | { | 335 | 2.47M | while ((unsigned) length > size) | 336 | 1.29M | { | 337 | 1.29M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 1.29M | length--; | 339 | 1.29M | } | 340 | 1.17M | } |
hb_vector_t<hb_bit_set_t::page_map_t, true>::shrink_vector(unsigned int) Line | Count | Source | 334 | 1.24M | { | 335 | 9.29M | while ((unsigned) length > size) | 336 | 8.04M | { | 337 | 8.04M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 8.04M | length--; | 339 | 8.04M | } | 340 | 1.24M | } |
hb_vector_t<hb_bit_page_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 1.24M | { | 335 | 9.29M | while ((unsigned) length > size) | 336 | 8.04M | { | 337 | 8.04M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 8.04M | length--; | 339 | 8.04M | } | 340 | 1.24M | } |
hb_vector_t<unsigned int, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 395k | { | 335 | 79.7M | while ((unsigned) length > size) | 336 | 79.3M | { | 337 | 79.3M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 79.3M | length--; | 339 | 79.3M | } | 340 | 395k | } |
hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 302k | { | 335 | 441k | while ((unsigned) length > size) | 336 | 138k | { | 337 | 138k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 138k | length--; | 339 | 138k | } | 340 | 302k | } |
hb_vector_t<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 10.3k | { | 335 | 22.8k | while ((unsigned) length > size) | 336 | 12.5k | { | 337 | 12.5k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 12.5k | length--; | 339 | 12.5k | } | 340 | 10.3k | } |
hb_vector_t<hb_serialize_context_t::object_t*, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 30.9k | { | 335 | 156k | while ((unsigned) length > size) | 336 | 125k | { | 337 | 125k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 125k | length--; | 339 | 125k | } | 340 | 30.9k | } |
Unexecuted instantiation: hb_vector_t<hb_vector_t<unsigned int, false>, false>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, true>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::shrink_vector(unsigned int) hb_vector_t<int, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 130k | { | 335 | 193M | while ((unsigned) length > size) | 336 | 193M | { | 337 | 193M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 193M | length--; | 339 | 193M | } | 340 | 130k | } |
Unexecuted instantiation: hb_vector_t<unsigned int, true>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t, false>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<hb_set_t, false>::shrink_vector(unsigned int) hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 1.55M | { | 335 | 3.86M | while ((unsigned) length > size) | 336 | 2.30M | { | 337 | 2.30M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 2.30M | length--; | 339 | 2.30M | } | 340 | 1.55M | } |
hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 148k | { | 335 | 295k | while ((unsigned) length > size) | 336 | 146k | { | 337 | 146k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 146k | length--; | 339 | 146k | } | 340 | 148k | } |
Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::shrink_vector(unsigned int) hb_vector_t<hb_transform_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 19.3k | { | 335 | 38.5k | while ((unsigned) length > size) | 336 | 19.1k | { | 337 | 19.1k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 19.1k | length--; | 339 | 19.1k | } | 340 | 19.3k | } |
hb_vector_t<hb_bounds_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 38.7k | { | 335 | 76.9k | while ((unsigned) length > size) | 336 | 38.2k | { | 337 | 38.2k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 38.2k | length--; | 339 | 38.2k | } | 340 | 38.7k | } |
Unexecuted instantiation: hb_vector_t<OT::LayerRecord, false>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<hb_set_t*, false>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<OT::index_map_subset_plan_t, false>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<OT::DeltaSetIndexMap const*, false>::shrink_vector(unsigned int) hb_vector_t<OT::contour_point_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 735k | { | 335 | 197M | while ((unsigned) length > size) | 336 | 196M | { | 337 | 196M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 196M | length--; | 339 | 196M | } | 340 | 735k | } |
Unexecuted instantiation: hb_vector_t<unsigned char, false>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<OT::glyf_impl::SubsetGlyph, false>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<hb_variation_t, false>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<OT::IndexSubtableRecord, false>::shrink_vector(unsigned int) hb_vector_t<char, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 2.83k | { | 335 | 554k | while ((unsigned) length > size) | 336 | 552k | { | 337 | 552k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 552k | length--; | 339 | 552k | } | 340 | 2.83k | } |
Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, false>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*, false>::shrink_vector(unsigned int) hb_vector_t<hb_ot_name_entry_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 230k | { | 335 | 5.84M | while ((unsigned) length > size) | 336 | 5.61M | { | 337 | 5.61M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 5.61M | length--; | 339 | 5.61M | } | 340 | 230k | } |
hb_vector_t<OT::cff1::accelerator_t::gname_t, true>::shrink_vector(unsigned int) Line | Count | Source | 334 | 18.6k | { | 335 | 8.33M | while ((unsigned) length > size) | 336 | 8.31M | { | 337 | 8.31M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 8.31M | length--; | 339 | 8.31M | } | 340 | 18.6k | } |
hb_vector_t<CFF::cff1_top_dict_val_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 563k | { | 335 | 901k | while ((unsigned) length > size) | 336 | 338k | { | 337 | 338k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 338k | length--; | 339 | 338k | } | 340 | 563k | } |
hb_vector_t<CFF::cff1_font_dict_values_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 563k | { | 335 | 911k | while ((unsigned) length > size) | 336 | 348k | { | 337 | 348k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 348k | length--; | 339 | 348k | } | 340 | 563k | } |
hb_vector_t<CFF::op_str_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 1.69M | { | 335 | 2.44M | while ((unsigned) length > size) | 336 | 747k | { | 337 | 747k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 747k | length--; | 339 | 747k | } | 340 | 1.69M | } |
hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 563k | { | 335 | 1.11M | while ((unsigned) length > size) | 336 | 556k | { | 337 | 556k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 556k | length--; | 339 | 556k | } | 340 | 563k | } |
hb_vector_t<CFF::dict_val_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 942k | { | 335 | 3.52M | while ((unsigned) length > size) | 336 | 2.58M | { | 337 | 2.58M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 2.58M | length--; | 339 | 2.58M | } | 340 | 942k | } |
hb_vector_t<CFF::cff2_font_dict_values_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 469k | { | 335 | 496k | while ((unsigned) length > size) | 336 | 27.1k | { | 337 | 27.1k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 27.1k | length--; | 339 | 27.1k | } | 340 | 469k | } |
hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 469k | { | 335 | 855k | while ((unsigned) length > size) | 336 | 385k | { | 337 | 385k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 385k | length--; | 339 | 385k | } | 340 | 469k | } |
Unexecuted instantiation: hb_vector_t<hb_array_t<unsigned char const>, false>::shrink_vector(unsigned int) Unexecuted instantiation: hb_vector_t<hb_ot_name_record_ids_t, false>::shrink_vector(unsigned int) hb_vector_t<float, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 20.8k | { | 335 | 23.1k | while ((unsigned) length > size) | 336 | 2.33k | { | 337 | 2.33k | arrayZ[(unsigned) length - 1].~Type (); | 338 | 2.33k | length--; | 339 | 2.33k | } | 340 | 20.8k | } |
Unexecuted instantiation: hb_vector_t<CFF::number_t, false>::shrink_vector(unsigned int) hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 625k | { | 335 | 8.82M | while ((unsigned) length > size) | 336 | 8.19M | { | 337 | 8.19M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 8.19M | length--; | 339 | 8.19M | } | 340 | 625k | } |
hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::shrink_vector(unsigned int) Line | Count | Source | 334 | 1.17M | { | 335 | 2.47M | while ((unsigned) length > size) | 336 | 1.29M | { | 337 | 1.29M | arrayZ[(unsigned) length - 1].~Type (); | 338 | 1.29M | length--; | 339 | 1.29M | } | 340 | 1.17M | } |
|
341 | | |
342 | | void |
343 | | shift_down_vector (unsigned i) |
344 | 0 | { |
345 | 0 | for (; i < length; i++) |
346 | 0 | arrayZ[i - 1] = std::move (arrayZ[i]); |
347 | 0 | } |
348 | | |
349 | | /* Allocate for size but don't adjust length. */ |
350 | | bool alloc (unsigned int size, bool exact=false) |
351 | 106M | { |
352 | 106M | if (unlikely (in_error ())) |
353 | 551k | return false; |
354 | | |
355 | 106M | unsigned int new_allocated; |
356 | 106M | if (exact) |
357 | 2.79M | { |
358 | | /* If exact was specified, we allow shrinking the storage. */ |
359 | 2.79M | size = hb_max (size, length); |
360 | 2.79M | if (size <= (unsigned) allocated && |
361 | 2.79M | size >= (unsigned) allocated >> 2) |
362 | 654k | return true; |
363 | | |
364 | 2.14M | new_allocated = size; |
365 | 2.14M | } |
366 | 103M | else |
367 | 103M | { |
368 | 103M | if (likely (size <= (unsigned) allocated)) |
369 | 98.0M | return true; |
370 | | |
371 | 5.41M | new_allocated = allocated; |
372 | 11.5M | while (size > new_allocated) |
373 | 6.10M | new_allocated += (new_allocated >> 1) + 8; |
374 | 5.41M | } |
375 | | |
376 | | |
377 | | /* Reallocate */ |
378 | | |
379 | 7.55M | bool overflows = |
380 | 7.55M | (int) in_error () || |
381 | 7.55M | (new_allocated < size) || |
382 | 7.55M | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); |
383 | | |
384 | 7.55M | if (unlikely (overflows)) |
385 | 0 | { |
386 | 0 | allocated = -1; |
387 | 0 | return false; |
388 | 0 | } |
389 | | |
390 | 7.55M | Type *new_array = realloc_vector (new_allocated); |
391 | | |
392 | 7.55M | if (unlikely (new_allocated && !new_array)) |
393 | 42.4k | { |
394 | 42.4k | if (new_allocated <= (unsigned) allocated) |
395 | 159 | return true; // shrinking failed; it's okay; happens in our fuzzer |
396 | | |
397 | 42.3k | allocated = -1; |
398 | 42.3k | return false; |
399 | 42.4k | } |
400 | | |
401 | 7.51M | arrayZ = new_array; |
402 | 7.51M | allocated = new_allocated; |
403 | | |
404 | 7.51M | return true; |
405 | 7.55M | } hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 146k | { | 352 | 146k | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 146k | unsigned int new_allocated; | 356 | 146k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 146k | else | 367 | 146k | { | 368 | 146k | if (likely (size <= (unsigned) allocated)) | 369 | 29.6k | return true; | 370 | | | 371 | 117k | new_allocated = allocated; | 372 | 234k | while (size > new_allocated) | 373 | 117k | new_allocated += (new_allocated >> 1) + 8; | 374 | 117k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 117k | bool overflows = | 380 | 117k | (int) in_error () || | 381 | 117k | (new_allocated < size) || | 382 | 117k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 117k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 117k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 117k | if (unlikely (new_allocated && !new_array)) | 393 | 1.37k | { | 394 | 1.37k | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 1.37k | allocated = -1; | 398 | 1.37k | return false; | 399 | 1.37k | } | 400 | | | 401 | 115k | arrayZ = new_array; | 402 | 115k | allocated = new_allocated; | 403 | | | 404 | 115k | return true; | 405 | 117k | } |
hb_vector_t<hb_aat_map_t::range_flags_t, true>::alloc(unsigned int, bool) Line | Count | Source | 351 | 164k | { | 352 | 164k | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 164k | unsigned int new_allocated; | 356 | 164k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 164k | else | 367 | 164k | { | 368 | 164k | if (likely (size <= (unsigned) allocated)) | 369 | 0 | return true; | 370 | | | 371 | 164k | new_allocated = allocated; | 372 | 329k | while (size > new_allocated) | 373 | 164k | new_allocated += (new_allocated >> 1) + 8; | 374 | 164k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 164k | bool overflows = | 380 | 164k | (int) in_error () || | 381 | 164k | (new_allocated < size) || | 382 | 164k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 164k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 164k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 164k | if (unlikely (new_allocated && !new_array)) | 393 | 1.92k | { | 394 | 1.92k | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 1.92k | allocated = -1; | 398 | 1.92k | return false; | 399 | 1.92k | } | 400 | | | 401 | 162k | arrayZ = new_array; | 402 | 162k | allocated = new_allocated; | 403 | | | 404 | 162k | return true; | 405 | 164k | } |
hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 200k | { | 352 | 200k | if (unlikely (in_error ())) | 353 | 2.34k | return false; | 354 | | | 355 | 198k | unsigned int new_allocated; | 356 | 198k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 198k | else | 367 | 198k | { | 368 | 198k | if (likely (size <= (unsigned) allocated)) | 369 | 0 | return true; | 370 | | | 371 | 198k | new_allocated = allocated; | 372 | 396k | while (size > new_allocated) | 373 | 198k | new_allocated += (new_allocated >> 1) + 8; | 374 | 198k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 198k | bool overflows = | 380 | 198k | (int) in_error () || | 381 | 198k | (new_allocated < size) || | 382 | 198k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 198k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 198k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 198k | if (unlikely (new_allocated && !new_array)) | 393 | 1.55k | { | 394 | 1.55k | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 1.55k | allocated = -1; | 398 | 1.55k | return false; | 399 | 1.55k | } | 400 | | | 401 | 196k | arrayZ = new_array; | 402 | 196k | allocated = new_allocated; | 403 | | | 404 | 196k | return true; | 405 | 198k | } |
hb_vector_t<hb_bit_page_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 8.10M | { | 352 | 8.10M | if (unlikely (in_error ())) | 353 | 2.15k | return false; | 354 | | | 355 | 8.10M | unsigned int new_allocated; | 356 | 8.10M | if (exact) | 357 | 303k | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 303k | size = hb_max (size, length); | 360 | 303k | if (size <= (unsigned) allocated && | 361 | 303k | size >= (unsigned) allocated >> 2) | 362 | 1.45k | return true; | 363 | | | 364 | 301k | new_allocated = size; | 365 | 301k | } | 366 | 7.80M | else | 367 | 7.80M | { | 368 | 7.80M | if (likely (size <= (unsigned) allocated)) | 369 | 7.66M | return true; | 370 | | | 371 | 138k | new_allocated = allocated; | 372 | 277k | while (size > new_allocated) | 373 | 138k | new_allocated += (new_allocated >> 1) + 8; | 374 | 138k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 440k | bool overflows = | 380 | 440k | (int) in_error () || | 381 | 440k | (new_allocated < size) || | 382 | 440k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 440k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 440k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 440k | if (unlikely (new_allocated && !new_array)) | 393 | 2.15k | { | 394 | 2.15k | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 2.15k | allocated = -1; | 398 | 2.15k | return false; | 399 | 2.15k | } | 400 | | | 401 | 438k | arrayZ = new_array; | 402 | 438k | allocated = new_allocated; | 403 | | | 404 | 438k | return true; | 405 | 440k | } |
hb_vector_t<hb_bit_set_t::page_map_t, true>::alloc(unsigned int, bool) Line | Count | Source | 351 | 8.09M | { | 352 | 8.09M | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 8.09M | unsigned int new_allocated; | 356 | 8.09M | if (exact) | 357 | 299k | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 299k | size = hb_max (size, length); | 360 | 299k | if (size <= (unsigned) allocated && | 361 | 299k | size >= (unsigned) allocated >> 2) | 362 | 32 | return true; | 363 | | | 364 | 299k | new_allocated = size; | 365 | 299k | } | 366 | 7.79M | else | 367 | 7.79M | { | 368 | 7.79M | if (likely (size <= (unsigned) allocated)) | 369 | 7.66M | return true; | 370 | | | 371 | 138k | new_allocated = allocated; | 372 | 276k | while (size > new_allocated) | 373 | 138k | new_allocated += (new_allocated >> 1) + 8; | 374 | 138k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 438k | bool overflows = | 380 | 438k | (int) in_error () || | 381 | 438k | (new_allocated < size) || | 382 | 438k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 438k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 438k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 438k | if (unlikely (new_allocated && !new_array)) | 393 | 1.75k | { | 394 | 1.75k | if (new_allocated <= (unsigned) allocated) | 395 | 3 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 1.75k | allocated = -1; | 398 | 1.75k | return false; | 399 | 1.75k | } | 400 | | | 401 | 436k | arrayZ = new_array; | 402 | 436k | allocated = new_allocated; | 403 | | | 404 | 436k | return true; | 405 | 438k | } |
hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 139k | { | 352 | 139k | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 139k | unsigned int new_allocated; | 356 | 139k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 139k | else | 367 | 139k | { | 368 | 139k | if (likely (size <= (unsigned) allocated)) | 369 | 89.3k | return true; | 370 | | | 371 | 49.9k | new_allocated = allocated; | 372 | 99.9k | while (size > new_allocated) | 373 | 49.9k | new_allocated += (new_allocated >> 1) + 8; | 374 | 49.9k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 49.9k | bool overflows = | 380 | 49.9k | (int) in_error () || | 381 | 49.9k | (new_allocated < size) || | 382 | 49.9k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 49.9k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 49.9k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 49.9k | if (unlikely (new_allocated && !new_array)) | 393 | 663 | { | 394 | 663 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 663 | allocated = -1; | 398 | 663 | return false; | 399 | 663 | } | 400 | | | 401 | 49.3k | arrayZ = new_array; | 402 | 49.3k | allocated = new_allocated; | 403 | | | 404 | 49.3k | return true; | 405 | 49.9k | } |
hb_vector_t<hb_serialize_context_t::object_t*, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 125k | { | 352 | 125k | if (unlikely (in_error ())) | 353 | 202 | return false; | 354 | | | 355 | 125k | unsigned int new_allocated; | 356 | 125k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 125k | else | 367 | 125k | { | 368 | 125k | if (likely (size <= (unsigned) allocated)) | 369 | 109k | return true; | 370 | | | 371 | 15.5k | new_allocated = allocated; | 372 | 31.1k | while (size > new_allocated) | 373 | 15.5k | new_allocated += (new_allocated >> 1) + 8; | 374 | 15.5k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 15.5k | bool overflows = | 380 | 15.5k | (int) in_error () || | 381 | 15.5k | (new_allocated < size) || | 382 | 15.5k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 15.5k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 15.5k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 15.5k | if (unlikely (new_allocated && !new_array)) | 393 | 268 | { | 394 | 268 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 268 | allocated = -1; | 398 | 268 | return false; | 399 | 268 | } | 400 | | | 401 | 15.2k | arrayZ = new_array; | 402 | 15.2k | allocated = new_allocated; | 403 | | | 404 | 15.2k | return true; | 405 | 15.5k | } |
hb_vector_t<unsigned int, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 17.1M | { | 352 | 17.1M | if (unlikely (in_error ())) | 353 | 340k | return false; | 354 | | | 355 | 16.7M | unsigned int new_allocated; | 356 | 16.7M | if (exact) | 357 | 52.3k | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 52.3k | size = hb_max (size, length); | 360 | 52.3k | if (size <= (unsigned) allocated && | 361 | 52.3k | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 52.3k | new_allocated = size; | 365 | 52.3k | } | 366 | 16.7M | else | 367 | 16.7M | { | 368 | 16.7M | if (likely (size <= (unsigned) allocated)) | 369 | 16.6M | return true; | 370 | | | 371 | 65.3k | new_allocated = allocated; | 372 | 383k | while (size > new_allocated) | 373 | 318k | new_allocated += (new_allocated >> 1) + 8; | 374 | 65.3k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 117k | bool overflows = | 380 | 117k | (int) in_error () || | 381 | 117k | (new_allocated < size) || | 382 | 117k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 117k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 117k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 117k | if (unlikely (new_allocated && !new_array)) | 393 | 467 | { | 394 | 467 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 467 | allocated = -1; | 398 | 467 | return false; | 399 | 467 | } | 400 | | | 401 | 117k | arrayZ = new_array; | 402 | 117k | allocated = new_allocated; | 403 | | | 404 | 117k | return true; | 405 | 117k | } |
Unexecuted instantiation: hb_vector_t<hb_vector_t<unsigned int, false>, false>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<unsigned int, true>::alloc(unsigned int, bool) hb_vector_t<hb_pool_t<hb_serialize_context_t::object_t, 32u>::chunk_t*, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 25.5k | { | 352 | 25.5k | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 25.5k | unsigned int new_allocated; | 356 | 25.5k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 25.5k | else | 367 | 25.5k | { | 368 | 25.5k | if (likely (size <= (unsigned) allocated)) | 369 | 15.1k | return true; | 370 | | | 371 | 10.3k | new_allocated = allocated; | 372 | 20.6k | while (size > new_allocated) | 373 | 10.3k | new_allocated += (new_allocated >> 1) + 8; | 374 | 10.3k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 10.3k | bool overflows = | 380 | 10.3k | (int) in_error () || | 381 | 10.3k | (new_allocated < size) || | 382 | 10.3k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 10.3k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 10.3k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 10.3k | if (unlikely (new_allocated && !new_array)) | 393 | 211 | { | 394 | 211 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 211 | allocated = -1; | 398 | 211 | return false; | 399 | 211 | } | 400 | | | 401 | 10.0k | arrayZ = new_array; | 402 | 10.0k | allocated = new_allocated; | 403 | | | 404 | 10.0k | return true; | 405 | 10.3k | } |
Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, true>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t, false>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<hb_set_t, false>::alloc(unsigned int, bool) hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 3.87M | { | 352 | 3.87M | if (unlikely (in_error ())) | 353 | 14.2k | return false; | 354 | | | 355 | 3.86M | unsigned int new_allocated; | 356 | 3.86M | if (exact) | 357 | 1.55M | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 1.55M | size = hb_max (size, length); | 360 | 1.55M | if (size <= (unsigned) allocated && | 361 | 1.55M | size >= (unsigned) allocated >> 2) | 362 | 297k | return true; | 363 | | | 364 | 1.25M | new_allocated = size; | 365 | 1.25M | } | 366 | 2.30M | else | 367 | 2.30M | { | 368 | 2.30M | if (likely (size <= (unsigned) allocated)) | 369 | 2.30M | return true; | 370 | | | 371 | 0 | new_allocated = allocated; | 372 | 0 | while (size > new_allocated) | 373 | 0 | new_allocated += (new_allocated >> 1) + 8; | 374 | 0 | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 1.25M | bool overflows = | 380 | 1.25M | (int) in_error () || | 381 | 1.25M | (new_allocated < size) || | 382 | 1.25M | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 1.25M | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 1.25M | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 1.25M | if (unlikely (new_allocated && !new_array)) | 393 | 6.39k | { | 394 | 6.39k | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 6.39k | allocated = -1; | 398 | 6.39k | return false; | 399 | 6.39k | } | 400 | | | 401 | 1.25M | arrayZ = new_array; | 402 | 1.25M | allocated = new_allocated; | 403 | | | 404 | 1.25M | return true; | 405 | 1.25M | } |
Unexecuted instantiation: hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::alloc(unsigned int, bool) hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 148k | { | 352 | 148k | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 148k | unsigned int new_allocated; | 356 | 148k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 148k | else | 367 | 148k | { | 368 | 148k | if (likely (size <= (unsigned) allocated)) | 369 | 0 | return true; | 370 | | | 371 | 148k | new_allocated = allocated; | 372 | 296k | while (size > new_allocated) | 373 | 148k | new_allocated += (new_allocated >> 1) + 8; | 374 | 148k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 148k | bool overflows = | 380 | 148k | (int) in_error () || | 381 | 148k | (new_allocated < size) || | 382 | 148k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 148k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 148k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 148k | if (unlikely (new_allocated && !new_array)) | 393 | 1.53k | { | 394 | 1.53k | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 1.53k | allocated = -1; | 398 | 1.53k | return false; | 399 | 1.53k | } | 400 | | | 401 | 146k | arrayZ = new_array; | 402 | 146k | allocated = new_allocated; | 403 | | | 404 | 146k | return true; | 405 | 148k | } |
hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::alloc(unsigned int, bool) Line | Count | Source | 351 | 293k | { | 352 | 293k | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 293k | unsigned int new_allocated; | 356 | 293k | if (exact) | 357 | 146k | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 146k | size = hb_max (size, length); | 360 | 146k | if (size <= (unsigned) allocated && | 361 | 146k | size >= (unsigned) allocated >> 2) | 362 | 146k | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 146k | else | 367 | 146k | { | 368 | 146k | if (likely (size <= (unsigned) allocated)) | 369 | 146k | return true; | 370 | | | 371 | 0 | new_allocated = allocated; | 372 | 0 | while (size > new_allocated) | 373 | 0 | new_allocated += (new_allocated >> 1) + 8; | 374 | 0 | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 0 | bool overflows = | 380 | 0 | (int) in_error () || | 381 | 0 | (new_allocated < size) || | 382 | 0 | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | |
| 384 | 0 | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 0 | Type *new_array = realloc_vector (new_allocated); | 391 | |
| 392 | 0 | if (unlikely (new_allocated && !new_array)) | 393 | 0 | { | 394 | 0 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 0 | allocated = -1; | 398 | 0 | return false; | 399 | 0 | } | 400 | | | 401 | 0 | arrayZ = new_array; | 402 | 0 | allocated = new_allocated; | 403 | |
| 404 | 0 | return true; | 405 | 0 | } |
Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, unsigned int>, false>::alloc(unsigned int, bool) hb_vector_t<hb_transform_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 530k | { | 352 | 530k | if (unlikely (in_error ())) | 353 | 287 | return false; | 354 | | | 355 | 530k | unsigned int new_allocated; | 356 | 530k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 530k | else | 367 | 530k | { | 368 | 530k | if (likely (size <= (unsigned) allocated)) | 369 | 508k | return true; | 370 | | | 371 | 21.9k | new_allocated = allocated; | 372 | 43.8k | while (size > new_allocated) | 373 | 21.9k | new_allocated += (new_allocated >> 1) + 8; | 374 | 21.9k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 21.9k | bool overflows = | 380 | 21.9k | (int) in_error () || | 381 | 21.9k | (new_allocated < size) || | 382 | 21.9k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 21.9k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 21.9k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 21.9k | if (unlikely (new_allocated && !new_array)) | 393 | 187 | { | 394 | 187 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 187 | allocated = -1; | 398 | 187 | return false; | 399 | 187 | } | 400 | | | 401 | 21.7k | arrayZ = new_array; | 402 | 21.7k | allocated = new_allocated; | 403 | | | 404 | 21.7k | return true; | 405 | 21.9k | } |
hb_vector_t<hb_bounds_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 4.11M | { | 352 | 4.11M | if (unlikely (in_error ())) | 353 | 593 | return false; | 354 | | | 355 | 4.11M | unsigned int new_allocated; | 356 | 4.11M | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 4.11M | else | 367 | 4.11M | { | 368 | 4.11M | if (likely (size <= (unsigned) allocated)) | 369 | 4.07M | return true; | 370 | | | 371 | 42.6k | new_allocated = allocated; | 372 | 85.2k | while (size > new_allocated) | 373 | 42.6k | new_allocated += (new_allocated >> 1) + 8; | 374 | 42.6k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 42.6k | bool overflows = | 380 | 42.6k | (int) in_error () || | 381 | 42.6k | (new_allocated < size) || | 382 | 42.6k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 42.6k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 42.6k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 42.6k | if (unlikely (new_allocated && !new_array)) | 393 | 469 | { | 394 | 469 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 469 | allocated = -1; | 398 | 469 | return false; | 399 | 469 | } | 400 | | | 401 | 42.1k | arrayZ = new_array; | 402 | 42.1k | allocated = new_allocated; | 403 | | | 404 | 42.1k | return true; | 405 | 42.6k | } |
Unexecuted instantiation: hb_vector_t<OT::LayerRecord, false>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<OT::index_map_subset_plan_t, false>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<hb_set_t*, false>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<OT::DeltaSetIndexMap const*, false>::alloc(unsigned int, bool) hb_vector_t<int, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 22.1M | { | 352 | 22.1M | if (unlikely (in_error ())) | 353 | 36 | return false; | 354 | | | 355 | 22.1M | unsigned int new_allocated; | 356 | 22.1M | if (exact) | 357 | 42.9k | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 42.9k | size = hb_max (size, length); | 360 | 42.9k | if (size <= (unsigned) allocated && | 361 | 42.9k | size >= (unsigned) allocated >> 2) | 362 | 29.4k | return true; | 363 | | | 364 | 13.5k | new_allocated = size; | 365 | 13.5k | } | 366 | 22.0M | else | 367 | 22.0M | { | 368 | 22.0M | if (likely (size <= (unsigned) allocated)) | 369 | 21.9M | return true; | 370 | | | 371 | 112k | new_allocated = allocated; | 372 | 444k | while (size > new_allocated) | 373 | 332k | new_allocated += (new_allocated >> 1) + 8; | 374 | 112k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 126k | bool overflows = | 380 | 126k | (int) in_error () || | 381 | 126k | (new_allocated < size) || | 382 | 126k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 126k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 126k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 126k | if (unlikely (new_allocated && !new_array)) | 393 | 2.01k | { | 394 | 2.01k | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 2.01k | allocated = -1; | 398 | 2.01k | return false; | 399 | 2.01k | } | 400 | | | 401 | 124k | arrayZ = new_array; | 402 | 124k | allocated = new_allocated; | 403 | | | 404 | 124k | return true; | 405 | 126k | } |
hb_vector_t<OT::contour_point_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 3.94M | { | 352 | 3.94M | if (unlikely (in_error ())) | 353 | 1.20k | return false; | 354 | | | 355 | 3.94M | unsigned int new_allocated; | 356 | 3.94M | if (exact) | 357 | 107k | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 107k | size = hb_max (size, length); | 360 | 107k | if (size <= (unsigned) allocated && | 361 | 107k | size >= (unsigned) allocated >> 2) | 362 | 4.38k | return true; | 363 | | | 364 | 103k | new_allocated = size; | 365 | 103k | } | 366 | 3.83M | else | 367 | 3.83M | { | 368 | 3.83M | if (likely (size <= (unsigned) allocated)) | 369 | 3.41M | return true; | 370 | | | 371 | 420k | new_allocated = allocated; | 372 | 1.03M | while (size > new_allocated) | 373 | 611k | new_allocated += (new_allocated >> 1) + 8; | 374 | 420k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 523k | bool overflows = | 380 | 523k | (int) in_error () || | 381 | 523k | (new_allocated < size) || | 382 | 523k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 523k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 523k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 523k | if (unlikely (new_allocated && !new_array)) | 393 | 4.27k | { | 394 | 4.27k | if (new_allocated <= (unsigned) allocated) | 395 | 5 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 4.27k | allocated = -1; | 398 | 4.27k | return false; | 399 | 4.27k | } | 400 | | | 401 | 519k | arrayZ = new_array; | 402 | 519k | allocated = new_allocated; | 403 | | | 404 | 519k | return true; | 405 | 523k | } |
Unexecuted instantiation: hb_vector_t<unsigned char, false>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<OT::glyf_impl::SubsetGlyph, false>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<hb_variation_t, false>::alloc(unsigned int, bool) hb_vector_t<char, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 2.83k | { | 352 | 2.83k | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 2.83k | unsigned int new_allocated; | 356 | 2.83k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 2.83k | else | 367 | 2.83k | { | 368 | 2.83k | if (likely (size <= (unsigned) allocated)) | 369 | 0 | return true; | 370 | | | 371 | 2.83k | new_allocated = allocated; | 372 | 22.7k | while (size > new_allocated) | 373 | 19.8k | new_allocated += (new_allocated >> 1) + 8; | 374 | 2.83k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 2.83k | bool overflows = | 380 | 2.83k | (int) in_error () || | 381 | 2.83k | (new_allocated < size) || | 382 | 2.83k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 2.83k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 2.83k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 2.83k | if (unlikely (new_allocated && !new_array)) | 393 | 159 | { | 394 | 159 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 159 | allocated = -1; | 398 | 159 | return false; | 399 | 159 | } | 400 | | | 401 | 2.68k | arrayZ = new_array; | 402 | 2.68k | allocated = new_allocated; | 403 | | | 404 | 2.68k | return true; | 405 | 2.83k | } |
Unexecuted instantiation: hb_vector_t<OT::IndexSubtableRecord, false>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<hb_pair_t<unsigned int, OT::IndexSubtableRecord const*>, false>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<OT::OffsetTo<OT::SBIXStrike, OT::IntType<unsigned int, 4u>, true>*, false>::alloc(unsigned int, bool) Unexecuted instantiation: hb_vector_t<hb_array_t<unsigned char const>, false>::alloc(unsigned int, bool) hb_vector_t<CFF::cff1_top_dict_val_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 339k | { | 352 | 339k | if (unlikely (in_error ())) | 353 | 933 | return false; | 354 | | | 355 | 338k | unsigned int new_allocated; | 356 | 338k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 338k | else | 367 | 338k | { | 368 | 338k | if (likely (size <= (unsigned) allocated)) | 369 | 276k | return true; | 370 | | | 371 | 62.0k | new_allocated = allocated; | 372 | 124k | while (size > new_allocated) | 373 | 62.0k | new_allocated += (new_allocated >> 1) + 8; | 374 | 62.0k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 62.0k | bool overflows = | 380 | 62.0k | (int) in_error () || | 381 | 62.0k | (new_allocated < size) || | 382 | 62.0k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 62.0k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 62.0k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 62.0k | if (unlikely (new_allocated && !new_array)) | 393 | 172 | { | 394 | 172 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 172 | allocated = -1; | 398 | 172 | return false; | 399 | 172 | } | 400 | | | 401 | 61.8k | arrayZ = new_array; | 402 | 61.8k | allocated = new_allocated; | 403 | | | 404 | 61.8k | return true; | 405 | 62.0k | } |
hb_vector_t<CFF::op_str_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 749k | { | 352 | 749k | if (unlikely (in_error ())) | 353 | 1.08k | return false; | 354 | | | 355 | 748k | unsigned int new_allocated; | 356 | 748k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 748k | else | 367 | 748k | { | 368 | 748k | if (likely (size <= (unsigned) allocated)) | 369 | 378k | return true; | 370 | | | 371 | 370k | new_allocated = allocated; | 372 | 741k | while (size > new_allocated) | 373 | 370k | new_allocated += (new_allocated >> 1) + 8; | 374 | 370k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 370k | bool overflows = | 380 | 370k | (int) in_error () || | 381 | 370k | (new_allocated < size) || | 382 | 370k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 370k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 370k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 370k | if (unlikely (new_allocated && !new_array)) | 393 | 809 | { | 394 | 809 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 809 | allocated = -1; | 398 | 809 | return false; | 399 | 809 | } | 400 | | | 401 | 369k | arrayZ = new_array; | 402 | 369k | allocated = new_allocated; | 403 | | | 404 | 369k | return true; | 405 | 370k | } |
hb_vector_t<CFF::dict_val_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 2.59M | { | 352 | 2.59M | if (unlikely (in_error ())) | 353 | 4.88k | return false; | 354 | | | 355 | 2.58M | unsigned int new_allocated; | 356 | 2.58M | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 2.58M | else | 367 | 2.58M | { | 368 | 2.58M | if (likely (size <= (unsigned) allocated)) | 369 | 2.18M | return true; | 370 | | | 371 | 398k | new_allocated = allocated; | 372 | 797k | while (size > new_allocated) | 373 | 398k | new_allocated += (new_allocated >> 1) + 8; | 374 | 398k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 398k | bool overflows = | 380 | 398k | (int) in_error () || | 381 | 398k | (new_allocated < size) || | 382 | 398k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 398k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 398k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 398k | if (unlikely (new_allocated && !new_array)) | 393 | 860 | { | 394 | 860 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 860 | allocated = -1; | 398 | 860 | return false; | 399 | 860 | } | 400 | | | 401 | 397k | arrayZ = new_array; | 402 | 397k | allocated = new_allocated; | 403 | | | 404 | 397k | return true; | 405 | 398k | } |
hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 26.5k | { | 352 | 26.5k | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 26.5k | unsigned int new_allocated; | 356 | 26.5k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 26.5k | else | 367 | 26.5k | { | 368 | 26.5k | if (likely (size <= (unsigned) allocated)) | 369 | 51 | return true; | 370 | | | 371 | 26.4k | new_allocated = allocated; | 372 | 66.6k | while (size > new_allocated) | 373 | 40.1k | new_allocated += (new_allocated >> 1) + 8; | 374 | 26.4k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 26.4k | bool overflows = | 380 | 26.4k | (int) in_error () || | 381 | 26.4k | (new_allocated < size) || | 382 | 26.4k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 26.4k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 26.4k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 26.4k | if (unlikely (new_allocated && !new_array)) | 393 | 32 | { | 394 | 32 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 32 | allocated = -1; | 398 | 32 | return false; | 399 | 32 | } | 400 | | | 401 | 26.4k | arrayZ = new_array; | 402 | 26.4k | allocated = new_allocated; | 403 | | | 404 | 26.4k | return true; | 405 | 26.4k | } |
hb_vector_t<CFF::cff1_font_dict_values_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 348k | { | 352 | 348k | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 348k | unsigned int new_allocated; | 356 | 348k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 348k | else | 367 | 348k | { | 368 | 348k | if (likely (size <= (unsigned) allocated)) | 369 | 334k | return true; | 370 | | | 371 | 13.8k | new_allocated = allocated; | 372 | 27.6k | while (size > new_allocated) | 373 | 13.8k | new_allocated += (new_allocated >> 1) + 8; | 374 | 13.8k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 13.8k | bool overflows = | 380 | 13.8k | (int) in_error () || | 381 | 13.8k | (new_allocated < size) || | 382 | 13.8k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 13.8k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 13.8k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 13.8k | if (unlikely (new_allocated && !new_array)) | 393 | 42 | { | 394 | 42 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 42 | allocated = -1; | 398 | 42 | return false; | 399 | 42 | } | 400 | | | 401 | 13.7k | arrayZ = new_array; | 402 | 13.7k | allocated = new_allocated; | 403 | | | 404 | 13.7k | return true; | 405 | 13.8k | } |
hb_vector_t<OT::cff1::accelerator_t::gname_t, true>::alloc(unsigned int, bool) Line | Count | Source | 351 | 8.31M | { | 352 | 8.31M | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 8.31M | unsigned int new_allocated; | 356 | 8.31M | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 8.31M | else | 367 | 8.31M | { | 368 | 8.31M | if (likely (size <= (unsigned) allocated)) | 369 | 8.20M | return true; | 370 | | | 371 | 106k | new_allocated = allocated; | 372 | 212k | while (size > new_allocated) | 373 | 106k | new_allocated += (new_allocated >> 1) + 8; | 374 | 106k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 106k | bool overflows = | 380 | 106k | (int) in_error () || | 381 | 106k | (new_allocated < size) || | 382 | 106k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 106k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 106k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 106k | if (unlikely (new_allocated && !new_array)) | 393 | 0 | { | 394 | 0 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 0 | allocated = -1; | 398 | 0 | return false; | 399 | 0 | } | 400 | | | 401 | 106k | arrayZ = new_array; | 402 | 106k | allocated = new_allocated; | 403 | | | 404 | 106k | return true; | 405 | 106k | } |
hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 12.7k | { | 352 | 12.7k | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 12.7k | unsigned int new_allocated; | 356 | 12.7k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 12.7k | else | 367 | 12.7k | { | 368 | 12.7k | if (likely (size <= (unsigned) allocated)) | 369 | 676 | return true; | 370 | | | 371 | 12.0k | new_allocated = allocated; | 372 | 25.3k | while (size > new_allocated) | 373 | 13.3k | new_allocated += (new_allocated >> 1) + 8; | 374 | 12.0k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 12.0k | bool overflows = | 380 | 12.0k | (int) in_error () || | 381 | 12.0k | (new_allocated < size) || | 382 | 12.0k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 12.0k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 12.0k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 12.0k | if (unlikely (new_allocated && !new_array)) | 393 | 27 | { | 394 | 27 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 27 | allocated = -1; | 398 | 27 | return false; | 399 | 27 | } | 400 | | | 401 | 12.0k | arrayZ = new_array; | 402 | 12.0k | allocated = new_allocated; | 403 | | | 404 | 12.0k | return true; | 405 | 12.0k | } |
hb_vector_t<CFF::cff2_font_dict_values_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 27.2k | { | 352 | 27.2k | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 27.2k | unsigned int new_allocated; | 356 | 27.2k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 27.2k | else | 367 | 27.2k | { | 368 | 27.2k | if (likely (size <= (unsigned) allocated)) | 369 | 14.9k | return true; | 370 | | | 371 | 12.2k | new_allocated = allocated; | 372 | 24.5k | while (size > new_allocated) | 373 | 12.2k | new_allocated += (new_allocated >> 1) + 8; | 374 | 12.2k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 12.2k | bool overflows = | 380 | 12.2k | (int) in_error () || | 381 | 12.2k | (new_allocated < size) || | 382 | 12.2k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 12.2k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 12.2k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 12.2k | if (unlikely (new_allocated && !new_array)) | 393 | 58 | { | 394 | 58 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 58 | allocated = -1; | 398 | 58 | return false; | 399 | 58 | } | 400 | | | 401 | 12.2k | arrayZ = new_array; | 402 | 12.2k | allocated = new_allocated; | 403 | | | 404 | 12.2k | return true; | 405 | 12.2k | } |
Unexecuted instantiation: hb_vector_t<hb_ot_name_record_ids_t, false>::alloc(unsigned int, bool) hb_vector_t<hb_ot_name_entry_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 6.01M | { | 352 | 6.01M | if (unlikely (in_error ())) | 353 | 9.21k | return false; | 354 | | | 355 | 6.01M | unsigned int new_allocated; | 356 | 6.01M | if (exact) | 357 | 197k | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 197k | size = hb_max (size, length); | 360 | 197k | if (size <= (unsigned) allocated && | 361 | 197k | size >= (unsigned) allocated >> 2) | 362 | 122k | return true; | 363 | | | 364 | 74.6k | new_allocated = size; | 365 | 74.6k | } | 366 | 5.81M | else | 367 | 5.81M | { | 368 | 5.81M | if (likely (size <= (unsigned) allocated)) | 369 | 5.81M | return true; | 370 | | | 371 | 0 | new_allocated = allocated; | 372 | 0 | while (size > new_allocated) | 373 | 0 | new_allocated += (new_allocated >> 1) + 8; | 374 | 0 | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 74.6k | bool overflows = | 380 | 74.6k | (int) in_error () || | 381 | 74.6k | (new_allocated < size) || | 382 | 74.6k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 74.6k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 74.6k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 74.6k | if (unlikely (new_allocated && !new_array)) | 393 | 327 | { | 394 | 327 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 327 | allocated = -1; | 398 | 327 | return false; | 399 | 327 | } | 400 | | | 401 | 74.2k | arrayZ = new_array; | 402 | 74.2k | allocated = new_allocated; | 403 | | | 404 | 74.2k | return true; | 405 | 74.6k | } |
hb_vector_t<float, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 203 | { | 352 | 203 | if (unlikely (in_error ())) | 353 | 0 | return false; | 354 | | | 355 | 203 | unsigned int new_allocated; | 356 | 203 | if (exact) | 357 | 203 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 203 | size = hb_max (size, length); | 360 | 203 | if (size <= (unsigned) allocated && | 361 | 203 | size >= (unsigned) allocated >> 2) | 362 | 32 | return true; | 363 | | | 364 | 171 | new_allocated = size; | 365 | 171 | } | 366 | 0 | else | 367 | 0 | { | 368 | 0 | if (likely (size <= (unsigned) allocated)) | 369 | 0 | return true; | 370 | | | 371 | 0 | new_allocated = allocated; | 372 | 0 | while (size > new_allocated) | 373 | 0 | new_allocated += (new_allocated >> 1) + 8; | 374 | 0 | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 171 | bool overflows = | 380 | 171 | (int) in_error () || | 381 | 171 | (new_allocated < size) || | 382 | 171 | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 171 | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 171 | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 171 | if (unlikely (new_allocated && !new_array)) | 393 | 8 | { | 394 | 8 | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 8 | allocated = -1; | 398 | 8 | return false; | 399 | 8 | } | 400 | | | 401 | 163 | arrayZ = new_array; | 402 | 163 | allocated = new_allocated; | 403 | | | 404 | 163 | return true; | 405 | 171 | } |
Unexecuted instantiation: hb_vector_t<CFF::number_t, false>::alloc(unsigned int, bool) hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 8.33M | { | 352 | 8.33M | if (unlikely (in_error ())) | 353 | 93.7k | return false; | 354 | | | 355 | 8.24M | unsigned int new_allocated; | 356 | 8.24M | if (exact) | 357 | 35.9k | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 35.9k | size = hb_max (size, length); | 360 | 35.9k | if (size <= (unsigned) allocated && | 361 | 35.9k | size >= (unsigned) allocated >> 2) | 362 | 35.9k | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 8.20M | else | 367 | 8.20M | { | 368 | 8.20M | if (likely (size <= (unsigned) allocated)) | 369 | 7.29M | return true; | 370 | | | 371 | 910k | new_allocated = allocated; | 372 | 1.82M | while (size > new_allocated) | 373 | 910k | new_allocated += (new_allocated >> 1) + 8; | 374 | 910k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 910k | bool overflows = | 380 | 910k | (int) in_error () || | 381 | 910k | (new_allocated < size) || | 382 | 910k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 910k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 910k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 910k | if (unlikely (new_allocated && !new_array)) | 393 | 5.10k | { | 394 | 5.10k | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 5.10k | allocated = -1; | 398 | 5.10k | return false; | 399 | 5.10k | } | 400 | | | 401 | 905k | arrayZ = new_array; | 402 | 905k | allocated = new_allocated; | 403 | | | 404 | 905k | return true; | 405 | 910k | } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 7.46M | { | 352 | 7.46M | if (unlikely (in_error ())) | 353 | 70.4k | return false; | 354 | | | 355 | 7.39M | unsigned int new_allocated; | 356 | 7.39M | if (exact) | 357 | 54.0k | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 54.0k | size = hb_max (size, length); | 360 | 54.0k | if (size <= (unsigned) allocated && | 361 | 54.0k | size >= (unsigned) allocated >> 2) | 362 | 15.2k | return true; | 363 | | | 364 | 38.7k | new_allocated = size; | 365 | 38.7k | } | 366 | 7.33M | else | 367 | 7.33M | { | 368 | 7.33M | if (likely (size <= (unsigned) allocated)) | 369 | 7.02M | return true; | 370 | | | 371 | 309k | new_allocated = allocated; | 372 | 619k | while (size > new_allocated) | 373 | 309k | new_allocated += (new_allocated >> 1) + 8; | 374 | 309k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 348k | bool overflows = | 380 | 348k | (int) in_error () || | 381 | 348k | (new_allocated < size) || | 382 | 348k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 348k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 348k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 348k | if (unlikely (new_allocated && !new_array)) | 393 | 1.29k | { | 394 | 1.29k | if (new_allocated <= (unsigned) allocated) | 395 | 151 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 1.14k | allocated = -1; | 398 | 1.14k | return false; | 399 | 1.29k | } | 400 | | | 401 | 347k | arrayZ = new_array; | 402 | 347k | allocated = new_allocated; | 403 | | | 404 | 347k | return true; | 405 | 348k | } |
hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 1.30M | { | 352 | 1.30M | if (unlikely (in_error ())) | 353 | 4.39k | return false; | 354 | | | 355 | 1.30M | unsigned int new_allocated; | 356 | 1.30M | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 1.30M | else | 367 | 1.30M | { | 368 | 1.30M | if (likely (size <= (unsigned) allocated)) | 369 | 681k | return true; | 370 | | | 371 | 622k | new_allocated = allocated; | 372 | 1.24M | while (size > new_allocated) | 373 | 622k | new_allocated += (new_allocated >> 1) + 8; | 374 | 622k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 622k | bool overflows = | 380 | 622k | (int) in_error () || | 381 | 622k | (new_allocated < size) || | 382 | 622k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 622k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 622k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 622k | if (unlikely (new_allocated && !new_array)) | 393 | 3.74k | { | 394 | 3.74k | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 3.74k | allocated = -1; | 398 | 3.74k | return false; | 399 | 3.74k | } | 400 | | | 401 | 618k | arrayZ = new_array; | 402 | 618k | allocated = new_allocated; | 403 | | | 404 | 618k | return true; | 405 | 622k | } |
hb_vector_t<hb_ot_map_t::feature_map_t, true>::alloc(unsigned int, bool) Line | Count | Source | 351 | 806k | { | 352 | 806k | if (unlikely (in_error ())) | 353 | 1.86k | return false; | 354 | | | 355 | 804k | unsigned int new_allocated; | 356 | 804k | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 804k | else | 367 | 804k | { | 368 | 804k | if (likely (size <= (unsigned) allocated)) | 369 | 503k | return true; | 370 | | | 371 | 301k | new_allocated = allocated; | 372 | 602k | while (size > new_allocated) | 373 | 301k | new_allocated += (new_allocated >> 1) + 8; | 374 | 301k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 301k | bool overflows = | 380 | 301k | (int) in_error () || | 381 | 301k | (new_allocated < size) || | 382 | 301k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 301k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 301k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 301k | if (unlikely (new_allocated && !new_array)) | 393 | 1.41k | { | 394 | 1.41k | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 1.41k | allocated = -1; | 398 | 1.41k | return false; | 399 | 1.41k | } | 400 | | | 401 | 300k | arrayZ = new_array; | 402 | 300k | allocated = new_allocated; | 403 | | | 404 | 300k | return true; | 405 | 301k | } |
hb_vector_t<hb_ot_map_t::stage_map_t, false>::alloc(unsigned int, bool) Line | Count | Source | 351 | 1.29M | { | 352 | 1.29M | if (unlikely (in_error ())) | 353 | 3.70k | return false; | 354 | | | 355 | 1.29M | unsigned int new_allocated; | 356 | 1.29M | if (exact) | 357 | 0 | { | 358 | | /* If exact was specified, we allow shrinking the storage. */ | 359 | 0 | size = hb_max (size, length); | 360 | 0 | if (size <= (unsigned) allocated && | 361 | 0 | size >= (unsigned) allocated >> 2) | 362 | 0 | return true; | 363 | | | 364 | 0 | new_allocated = size; | 365 | 0 | } | 366 | 1.29M | else | 367 | 1.29M | { | 368 | 1.29M | if (likely (size <= (unsigned) allocated)) | 369 | 677k | return true; | 370 | | | 371 | 618k | new_allocated = allocated; | 372 | 1.23M | while (size > new_allocated) | 373 | 618k | new_allocated += (new_allocated >> 1) + 8; | 374 | 618k | } | 375 | | | 376 | | | 377 | | /* Reallocate */ | 378 | | | 379 | 618k | bool overflows = | 380 | 618k | (int) in_error () || | 381 | 618k | (new_allocated < size) || | 382 | 618k | hb_unsigned_mul_overflows (new_allocated, sizeof (Type)); | 383 | | | 384 | 618k | if (unlikely (overflows)) | 385 | 0 | { | 386 | 0 | allocated = -1; | 387 | 0 | return false; | 388 | 0 | } | 389 | | | 390 | 618k | Type *new_array = realloc_vector (new_allocated); | 391 | | | 392 | 618k | if (unlikely (new_allocated && !new_array)) | 393 | 3.18k | { | 394 | 3.18k | if (new_allocated <= (unsigned) allocated) | 395 | 0 | return true; // shrinking failed; it's okay; happens in our fuzzer | 396 | | | 397 | 3.18k | allocated = -1; | 398 | 3.18k | return false; | 399 | 3.18k | } | 400 | | | 401 | 614k | arrayZ = new_array; | 402 | 614k | allocated = new_allocated; | 403 | | | 404 | 614k | return true; | 405 | 618k | } |
|
406 | | |
407 | | bool resize (int size_, bool initialize = true, bool exact = false) |
408 | 48.5M | { |
409 | 48.5M | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; |
410 | 48.5M | if (!alloc (size, exact)) |
411 | 228k | return false; |
412 | | |
413 | 48.3M | if (size > length) |
414 | 44.8M | { |
415 | 44.8M | if (initialize) |
416 | 44.4M | grow_vector (size); |
417 | 44.8M | } |
418 | 3.48M | else if (size < length) |
419 | 259k | { |
420 | 259k | if (initialize) |
421 | 258k | shrink_vector (size); |
422 | 259k | } |
423 | | |
424 | 48.3M | length = size; |
425 | 48.3M | return true; |
426 | 48.5M | } hb_vector_t<hb_vector_t<hb_aat_map_t::range_flags_t, true>, false>::resize(int, bool, bool) Line | Count | Source | 408 | 146k | { | 409 | 146k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 146k | if (!alloc (size, exact)) | 411 | 1.37k | return false; | 412 | | | 413 | 145k | if (size > length) | 414 | 115k | { | 415 | 115k | if (initialize) | 416 | 115k | grow_vector (size); | 417 | 115k | } | 418 | 29.6k | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 145k | length = size; | 425 | 145k | return true; | 426 | 146k | } |
hb_vector_t<hb_bit_page_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 8.10M | { | 409 | 8.10M | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 8.10M | if (!alloc (size, exact)) | 411 | 4.31k | return false; | 412 | | | 413 | 8.10M | if (size > length) | 414 | 8.04M | { | 415 | 8.04M | if (initialize) | 416 | 8.04M | grow_vector (size); | 417 | 8.04M | } | 418 | 54.0k | else if (size < length) | 419 | 54.0k | { | 420 | 54.0k | if (initialize) | 421 | 54.0k | shrink_vector (size); | 422 | 54.0k | } | 423 | | | 424 | 8.10M | length = size; | 425 | 8.10M | return true; | 426 | 8.10M | } |
hb_vector_t<hb_bit_set_t::page_map_t, true>::resize(int, bool, bool) Line | Count | Source | 408 | 8.09M | { | 409 | 8.09M | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 8.09M | if (!alloc (size, exact)) | 411 | 1.75k | return false; | 412 | | | 413 | 8.09M | if (size > length) | 414 | 8.04M | { | 415 | 8.04M | if (initialize) | 416 | 8.04M | grow_vector (size); | 417 | 8.04M | } | 418 | 52.3k | else if (size < length) | 419 | 52.3k | { | 420 | 52.3k | if (initialize) | 421 | 52.3k | shrink_vector (size); | 422 | 52.3k | } | 423 | | | 424 | 8.09M | length = size; | 425 | 8.09M | return true; | 426 | 8.09M | } |
hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 139k | { | 409 | 139k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 139k | if (!alloc (size, exact)) | 411 | 663 | return false; | 412 | | | 413 | 138k | if (size > length) | 414 | 138k | { | 415 | 138k | if (initialize) | 416 | 138k | grow_vector (size); | 417 | 138k | } | 418 | 0 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 138k | length = size; | 425 | 138k | return true; | 426 | 139k | } |
Unexecuted instantiation: hb_vector_t<hb_vector_t<unsigned int, false>, false>::resize(int, bool, bool) hb_vector_t<unsigned int, false>::resize(int, bool, bool) Line | Count | Source | 408 | 96.1k | { | 409 | 96.1k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 96.1k | if (!alloc (size, exact)) | 411 | 170 | return false; | 412 | | | 413 | 95.9k | if (size > length) | 414 | 65.0k | { | 415 | 65.0k | if (initialize) | 416 | 52.3k | grow_vector (size); | 417 | 65.0k | } | 418 | 30.8k | else if (size < length) | 419 | 2 | { | 420 | 2 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 2 | } | 423 | | | 424 | 95.9k | length = size; | 425 | 95.9k | return true; | 426 | 96.1k | } |
Unexecuted instantiation: hb_vector_t<OT::VarData::serialize(hb_serialize_context_t*, OT::VarData const*, hb_inc_bimap_t const&, hb_bimap_t const&)::delta_size_t, false>::resize(int, bool, bool) Unexecuted instantiation: hb_vector_t<hb_inc_bimap_t, false>::resize(int, bool, bool) Unexecuted instantiation: hb_vector_t<hb_set_t, false>::resize(int, bool, bool) Unexecuted instantiation: hb_vector_t<unsigned int, true>::resize(int, bool, bool) hb_vector_t<OT::hb_accelerate_subtables_context_t::hb_applicable_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 2.32M | { | 409 | 2.32M | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 2.32M | if (!alloc (size, exact)) | 411 | 14.2k | return false; | 412 | | | 413 | 2.30M | if (size > length) | 414 | 2.30M | { | 415 | 2.30M | if (initialize) | 416 | 2.30M | grow_vector (size); | 417 | 2.30M | } | 418 | 0 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 2.30M | length = size; | 425 | 2.30M | return true; | 426 | 2.32M | } |
Unexecuted instantiation: hb_vector_t<hb_aat_map_builder_t::feature_range_t, true>::resize(int, bool, bool) hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 148k | { | 409 | 148k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 148k | if (!alloc (size, exact)) | 411 | 1.53k | return false; | 412 | | | 413 | 146k | if (size > length) | 414 | 146k | { | 415 | 146k | if (initialize) | 416 | 146k | grow_vector (size); | 417 | 146k | } | 418 | 0 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 146k | length = size; | 425 | 146k | return true; | 426 | 148k | } |
hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::resize(int, bool, bool) Line | Count | Source | 408 | 146k | { | 409 | 146k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 146k | if (!alloc (size, exact)) | 411 | 0 | return false; | 412 | | | 413 | 146k | if (size > length) | 414 | 0 | { | 415 | 0 | if (initialize) | 416 | 0 | grow_vector (size); | 417 | 0 | } | 418 | 146k | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 146k | length = size; | 425 | 146k | return true; | 426 | 146k | } |
Unexecuted instantiation: hb_vector_t<OT::LayerRecord, false>::resize(int, bool, bool) Unexecuted instantiation: hb_vector_t<OT::index_map_subset_plan_t, false>::resize(int, bool, bool) Unexecuted instantiation: hb_vector_t<hb_set_t*, false>::resize(int, bool, bool) hb_vector_t<OT::contour_point_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 3.84M | { | 409 | 3.84M | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 3.84M | if (!alloc (size, exact)) | 411 | 4.71k | return false; | 412 | | | 413 | 3.83M | if (size > length) | 414 | 869k | { | 415 | 869k | if (initialize) | 416 | 596k | grow_vector (size); | 417 | 869k | } | 418 | 2.96M | else if (size < length) | 419 | 119k | { | 420 | 119k | if (initialize) | 421 | 119k | shrink_vector (size); | 422 | 119k | } | 423 | | | 424 | 3.83M | length = size; | 425 | 3.83M | return true; | 426 | 3.84M | } |
hb_vector_t<int, false>::resize(int, bool, bool) Line | Count | Source | 408 | 143k | { | 409 | 143k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 143k | if (!alloc (size, exact)) | 411 | 2.02k | return false; | 412 | | | 413 | 141k | if (size > length) | 414 | 139k | { | 415 | 139k | if (initialize) | 416 | 84.4k | grow_vector (size); | 417 | 139k | } | 418 | 2.43k | else if (size < length) | 419 | 290 | { | 420 | 290 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 290 | } | 423 | | | 424 | 141k | length = size; | 425 | 141k | return true; | 426 | 143k | } |
Unexecuted instantiation: hb_vector_t<OT::glyf_impl::SubsetGlyph, false>::resize(int, bool, bool) Unexecuted instantiation: hb_vector_t<OT::IndexSubtableRecord, false>::resize(int, bool, bool) Unexecuted instantiation: hb_vector_t<hb_array_t<unsigned char const>, false>::resize(int, bool, bool) hb_vector_t<CFF::cff1_private_dict_values_base_t<CFF::dict_val_t>, false>::resize(int, bool, bool) Line | Count | Source | 408 | 26.5k | { | 409 | 26.5k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 26.5k | if (!alloc (size, exact)) | 411 | 32 | return false; | 412 | | | 413 | 26.4k | if (size > length) | 414 | 26.4k | { | 415 | 26.4k | if (initialize) | 416 | 26.4k | grow_vector (size); | 417 | 26.4k | } | 418 | 51 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 26.4k | length = size; | 425 | 26.4k | return true; | 426 | 26.5k | } |
hb_vector_t<CFF::cff1_font_dict_values_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 348k | { | 409 | 348k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 348k | if (!alloc (size, exact)) | 411 | 42 | return false; | 412 | | | 413 | 348k | if (size > length) | 414 | 348k | { | 415 | 348k | if (initialize) | 416 | 348k | grow_vector (size); | 417 | 348k | } | 418 | 0 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 348k | length = size; | 425 | 348k | return true; | 426 | 348k | } |
hb_vector_t<CFF::cff2_private_dict_values_base_t<CFF::dict_val_t>, false>::resize(int, bool, bool) Line | Count | Source | 408 | 12.7k | { | 409 | 12.7k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 12.7k | if (!alloc (size, exact)) | 411 | 27 | return false; | 412 | | | 413 | 12.7k | if (size > length) | 414 | 12.0k | { | 415 | 12.0k | if (initialize) | 416 | 12.0k | grow_vector (size); | 417 | 12.0k | } | 418 | 676 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 12.7k | length = size; | 425 | 12.7k | return true; | 426 | 12.7k | } |
hb_vector_t<CFF::cff2_font_dict_values_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 27.2k | { | 409 | 27.2k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 27.2k | if (!alloc (size, exact)) | 411 | 58 | return false; | 412 | | | 413 | 27.1k | if (size > length) | 414 | 27.1k | { | 415 | 27.1k | if (initialize) | 416 | 27.1k | grow_vector (size); | 417 | 27.1k | } | 418 | 0 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 27.1k | length = size; | 425 | 27.1k | return true; | 426 | 27.2k | } |
hb_vector_t<hb_ot_name_entry_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 5.82M | { | 409 | 5.82M | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 5.82M | if (!alloc (size, exact)) | 411 | 9.21k | return false; | 412 | | | 413 | 5.81M | if (size > length) | 414 | 5.61M | { | 415 | 5.61M | if (initialize) | 416 | 5.61M | grow_vector (size); | 417 | 5.61M | } | 418 | 197k | else if (size < length) | 419 | 33.4k | { | 420 | 33.4k | if (initialize) | 421 | 33.4k | shrink_vector (size); | 422 | 33.4k | } | 423 | | | 424 | 5.81M | length = size; | 425 | 5.81M | return true; | 426 | 5.82M | } |
hb_vector_t<char, false>::resize(int, bool, bool) Line | Count | Source | 408 | 2.83k | { | 409 | 2.83k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 2.83k | if (!alloc (size, exact)) | 411 | 159 | return false; | 412 | | | 413 | 2.68k | if (size > length) | 414 | 2.68k | { | 415 | 2.68k | if (initialize) | 416 | 2.68k | grow_vector (size); | 417 | 2.68k | } | 418 | 0 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 2.68k | length = size; | 425 | 2.68k | return true; | 426 | 2.83k | } |
hb_vector_t<float, false>::resize(int, bool, bool) Line | Count | Source | 408 | 203 | { | 409 | 203 | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 203 | if (!alloc (size, exact)) | 411 | 8 | return false; | 412 | | | 413 | 195 | if (size > length) | 414 | 163 | { | 415 | 163 | if (initialize) | 416 | 163 | grow_vector (size); | 417 | 163 | } | 418 | 32 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 195 | length = size; | 425 | 195 | return true; | 426 | 203 | } |
Unexecuted instantiation: hb_vector_t<CFF::number_t, false>::resize(int, bool, bool) hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 8.29M | { | 409 | 8.29M | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 8.29M | if (!alloc (size, exact)) | 411 | 98.6k | return false; | 412 | | | 413 | 8.19M | if (size > length) | 414 | 8.19M | { | 415 | 8.19M | if (initialize) | 416 | 8.19M | grow_vector (size); | 417 | 8.19M | } | 418 | 0 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 8.19M | length = size; | 425 | 8.19M | return true; | 426 | 8.29M | } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 7.40M | { | 409 | 7.40M | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 7.40M | if (!alloc (size, exact)) | 411 | 70.9k | return false; | 412 | | | 413 | 7.33M | if (size > length) | 414 | 7.33M | { | 415 | 7.33M | if (initialize) | 416 | 7.33M | grow_vector (size); | 417 | 7.33M | } | 418 | 0 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 7.33M | length = size; | 425 | 7.33M | return true; | 426 | 7.40M | } |
hb_vector_t<hb_ot_map_builder_t::stage_info_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 1.30M | { | 409 | 1.30M | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 1.30M | if (!alloc (size, exact)) | 411 | 8.14k | return false; | 412 | | | 413 | 1.29M | if (size > length) | 414 | 1.29M | { | 415 | 1.29M | if (initialize) | 416 | 1.29M | grow_vector (size); | 417 | 1.29M | } | 418 | 0 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 1.29M | length = size; | 425 | 1.29M | return true; | 426 | 1.30M | } |
hb_vector_t<hb_ot_map_t::feature_map_t, true>::resize(int, bool, bool) Line | Count | Source | 408 | 806k | { | 409 | 806k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 806k | if (!alloc (size, exact)) | 411 | 3.27k | return false; | 412 | | | 413 | 803k | if (size > length) | 414 | 803k | { | 415 | 803k | if (initialize) | 416 | 803k | grow_vector (size); | 417 | 803k | } | 418 | 0 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 803k | length = size; | 425 | 803k | return true; | 426 | 806k | } |
hb_vector_t<hb_ot_map_t::stage_map_t, false>::resize(int, bool, bool) Line | Count | Source | 408 | 1.29M | { | 409 | 1.29M | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 410 | 1.29M | if (!alloc (size, exact)) | 411 | 6.88k | return false; | 412 | | | 413 | 1.29M | if (size > length) | 414 | 1.29M | { | 415 | 1.29M | if (initialize) | 416 | 1.29M | grow_vector (size); | 417 | 1.29M | } | 418 | 0 | else if (size < length) | 419 | 0 | { | 420 | 0 | if (initialize) | 421 | 0 | shrink_vector (size); | 422 | 0 | } | 423 | | | 424 | 1.29M | length = size; | 425 | 1.29M | return true; | 426 | 1.29M | } |
|
427 | | bool resize_exact (int size_, bool initialize = true) |
428 | 52.5k | { |
429 | 52.5k | return resize (size_, initialize, true); |
430 | 52.5k | } hb_vector_t<unsigned int, false>::resize_exact(int, bool) Line | Count | Source | 428 | 52.3k | { | 429 | 52.3k | return resize (size_, initialize, true); | 430 | 52.3k | } |
hb_vector_t<float, false>::resize_exact(int, bool) Line | Count | Source | 428 | 203 | { | 429 | 203 | return resize (size_, initialize, true); | 430 | 203 | } |
Unexecuted instantiation: hb_vector_t<CFF::number_t, false>::resize_exact(int, bool) |
431 | | |
432 | | Type pop () |
433 | 4.78M | { |
434 | 4.78M | if (!length) return Null (Type); |
435 | 4.78M | Type v {std::move (arrayZ[length - 1])}; |
436 | 4.78M | arrayZ[length - 1].~Type (); |
437 | 4.78M | length--; |
438 | 4.78M | return v; |
439 | 4.78M | } hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::pop() Line | Count | Source | 433 | 196k | { | 434 | 196k | if (!length) return Null (Type); | 435 | 196k | Type v {std::move (arrayZ[length - 1])}; | 436 | 196k | arrayZ[length - 1].~Type (); | 437 | 196k | length--; | 438 | 196k | return v; | 439 | 196k | } |
Unexecuted instantiation: hb_vector_t<hb_serialize_context_t::object_t*, false>::pop() Unexecuted instantiation: hb_vector_t<hb_set_t, false>::pop() hb_vector_t<hb_transform_t, false>::pop() Line | Count | Source | 433 | 511k | { | 434 | 511k | if (!length) return Null (Type); | 435 | 510k | Type v {std::move (arrayZ[length - 1])}; | 436 | 510k | arrayZ[length - 1].~Type (); | 437 | 510k | length--; | 438 | 510k | return v; | 439 | 511k | } |
hb_vector_t<hb_bounds_t, false>::pop() Line | Count | Source | 433 | 4.07M | { | 434 | 4.07M | if (!length) return Null (Type); | 435 | 4.07M | Type v {std::move (arrayZ[length - 1])}; | 436 | 4.07M | arrayZ[length - 1].~Type (); | 437 | 4.07M | length--; | 438 | 4.07M | return v; | 439 | 4.07M | } |
|
440 | | |
441 | | void remove_ordered (unsigned int i) |
442 | 0 | { |
443 | 0 | if (unlikely (i >= length)) |
444 | 0 | return; |
445 | 0 | shift_down_vector (i + 1); |
446 | 0 | arrayZ[length - 1].~Type (); |
447 | 0 | length--; |
448 | 0 | } |
449 | | |
450 | | template <bool Sorted = sorted, |
451 | | hb_enable_if (!Sorted)> |
452 | | void remove_unordered (unsigned int i) |
453 | | { |
454 | | if (unlikely (i >= length)) |
455 | | return; |
456 | | if (i != length - 1) |
457 | | arrayZ[i] = std::move (arrayZ[length - 1]); |
458 | | arrayZ[length - 1].~Type (); |
459 | | length--; |
460 | | } |
461 | | |
462 | | void shrink (int size_) |
463 | 427k | { |
464 | 427k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; |
465 | 427k | if (size >= length) |
466 | 336k | return; |
467 | | |
468 | 90.8k | shrink_vector (size); |
469 | | |
470 | 90.8k | alloc (size, true); /* To force shrinking memory if needed. */ |
471 | 90.8k | } Unexecuted instantiation: hb_vector_t<hb_serialize_context_t::object_t::link_t, false>::shrink(int) Unexecuted instantiation: hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::shrink(int) Unexecuted instantiation: hb_vector_t<char, false>::shrink(int) Unexecuted instantiation: hb_vector_t<CFF::number_t, false>::shrink(int) hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::shrink(int) Line | Count | Source | 463 | 292k | { | 464 | 292k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 465 | 292k | if (size >= length) | 466 | 256k | return; | 467 | | | 468 | 36.1k | shrink_vector (size); | 469 | | | 470 | 36.1k | alloc (size, true); /* To force shrinking memory if needed. */ | 471 | 36.1k | } |
hb_vector_t<hb_ot_map_t::lookup_map_t, false>::shrink(int) Line | Count | Source | 463 | 134k | { | 464 | 134k | unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; | 465 | 134k | if (size >= length) | 466 | 79.7k | return; | 467 | | | 468 | 54.6k | shrink_vector (size); | 469 | | | 470 | 54.6k | alloc (size, true); /* To force shrinking memory if needed. */ | 471 | 54.6k | } |
|
472 | | |
473 | | |
474 | | /* Sorting API. */ |
475 | | void qsort (int (*cmp)(const void*, const void*) = Type::cmp) |
476 | 657k | { as_array ().qsort (cmp); } Unexecuted instantiation: hb_vector_t<unsigned int, false>::qsort(int (*)(void const*, void const*)) hb_vector_t<hb_aat_map_builder_t::feature_event_t, false>::qsort(int (*)(void const*, void const*)) Line | Count | Source | 476 | 148k | { as_array ().qsort (cmp); } |
Unexecuted instantiation: hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::qsort(int (*)(void const*, void const*)) hb_vector_t<OT::cff1::accelerator_t::gname_t, true>::qsort(int (*)(void const*, void const*)) Line | Count | Source | 476 | 18.6k | { as_array ().qsort (cmp); } |
hb_vector_t<hb_ot_name_entry_t, false>::qsort(int (*)(void const*, void const*)) Line | Count | Source | 476 | 197k | { as_array ().qsort (cmp); } |
hb_vector_t<hb_ot_map_builder_t::feature_info_t, false>::qsort(int (*)(void const*, void const*)) Line | Count | Source | 476 | 292k | { as_array ().qsort (cmp); } |
|
477 | | |
478 | | /* Unsorted search API. */ |
479 | | template <typename T> |
480 | | Type *lsearch (const T &x, Type *not_found = nullptr) |
481 | 738k | { return as_array ().lsearch (x, not_found); } hb_user_data_array_t::hb_user_data_item_t* hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::lsearch<hb_user_data_key_t*>(hb_user_data_key_t* const&, hb_user_data_array_t::hb_user_data_item_t*) Line | Count | Source | 481 | 390k | { return as_array ().lsearch (x, not_found); } |
hb_user_data_array_t::hb_user_data_item_t* hb_vector_t<hb_user_data_array_t::hb_user_data_item_t, false>::lsearch<hb_user_data_array_t::hb_user_data_item_t>(hb_user_data_array_t::hb_user_data_item_t const&, hb_user_data_array_t::hb_user_data_item_t*) Line | Count | Source | 481 | 200k | { return as_array ().lsearch (x, not_found); } |
hb_aat_map_builder_t::feature_info_t* hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::lsearch<hb_aat_map_builder_t::feature_info_t>(hb_aat_map_builder_t::feature_info_t const&, hb_aat_map_builder_t::feature_info_t*) Line | Count | Source | 481 | 146k | { return as_array ().lsearch (x, not_found); } |
|
482 | | template <typename T> |
483 | | const Type *lsearch (const T &x, const Type *not_found = nullptr) const |
484 | | { return as_array ().lsearch (x, not_found); } |
485 | | template <typename T> |
486 | | bool lfind (const T &x, unsigned *pos = nullptr) const |
487 | | { return as_array ().lfind (x, pos); } |
488 | | |
489 | | /* Sorted search API. */ |
490 | | template <typename T, |
491 | | bool Sorted=sorted, hb_enable_if (Sorted)> |
492 | | Type *bsearch (const T &x, Type *not_found = nullptr) |
493 | 18.6k | { return as_array ().bsearch (x, not_found); } |
494 | | template <typename T, |
495 | | bool Sorted=sorted, hb_enable_if (Sorted)> |
496 | | const Type *bsearch (const T &x, const Type *not_found = nullptr) const |
497 | 3.41M | { return as_array ().bsearch (x, not_found); } hb_aat_map_builder_t::feature_info_t const* hb_vector_t<hb_aat_map_builder_t::feature_info_t, true>::bsearch<hb_aat_map_builder_t::feature_info_t, true, (void*)0>(hb_aat_map_builder_t::feature_info_t const&, hb_aat_map_builder_t::feature_info_t const*) const Line | Count | Source | 497 | 337k | { return as_array ().bsearch (x, not_found); } |
hb_ot_map_t::feature_map_t const* hb_vector_t<hb_ot_map_t::feature_map_t, true>::bsearch<unsigned int, true, (void*)0>(unsigned int const&, hb_ot_map_t::feature_map_t const*) const Line | Count | Source | 497 | 3.07M | { return as_array ().bsearch (x, not_found); } |
|
498 | | template <typename T, |
499 | | bool Sorted=sorted, hb_enable_if (Sorted)> |
500 | | bool bfind (const T &x, unsigned int *i = nullptr, |
501 | | hb_not_found_t not_found = HB_NOT_FOUND_DONT_STORE, |
502 | | unsigned int to_store = (unsigned int) -1) const |
503 | 9.06M | { return as_array ().bfind (x, i, not_found, to_store); } Unexecuted instantiation: bool hb_vector_t<hb_bit_set_t::page_map_t, true>::bfind<unsigned int, true, (void*)0>(unsigned int const&, unsigned int*, hb_not_found_t, unsigned int) const bool hb_vector_t<hb_bit_set_t::page_map_t, true>::bfind<hb_bit_set_t::page_map_t, true, (void*)0>(hb_bit_set_t::page_map_t const&, unsigned int*, hb_not_found_t, unsigned int) const Line | Count | Source | 503 | 9.06M | { return as_array ().bfind (x, i, not_found, to_store); } |
|
504 | | }; |
505 | | |
506 | | template <typename Type> |
507 | | using hb_sorted_vector_t = hb_vector_t<Type, true>; |
508 | | |
509 | | #endif /* HB_VECTOR_HH */ |