mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 01:00:37 +00:00
[graph] Pre-alloc priority-heap array
This commit is contained in:
parent
29f8d9f795
commit
9c4d3c3c70
2 changed files with 4 additions and 0 deletions
|
@ -567,6 +567,7 @@ struct graph_t
|
|||
update_distances ();
|
||||
|
||||
hb_priority_queue_t<int64_t> queue;
|
||||
queue.alloc (vertices_.length);
|
||||
hb_vector_t<vertex_t> &sorted_graph = vertices_scratch_;
|
||||
if (unlikely (!check_success (sorted_graph.resize (vertices_.length)))) return;
|
||||
hb_vector_t<unsigned> id_map;
|
||||
|
|
|
@ -55,6 +55,9 @@ struct hb_priority_queue_t
|
|||
|
||||
bool in_error () const { return heap.in_error (); }
|
||||
|
||||
bool alloc (unsigned size)
|
||||
{ return heap.alloc (size); }
|
||||
|
||||
#ifndef HB_OPTIMIZE_SIZE
|
||||
HB_ALWAYS_INLINE
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue