From bff8248a9d44654d7901150e86e684af0cfa8681 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 18 May 2022 16:25:03 -0600 Subject: [PATCH] [repacker] Pre-alloc vertices --- src/hb-repacker.hh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hb-repacker.hh b/src/hb-repacker.hh index 4af484afc..6af802f49 100644 --- a/src/hb-repacker.hh +++ b/src/hb-repacker.hh @@ -148,6 +148,8 @@ struct graph_t { num_roots_for_space_.push (1); bool removed_nil = false; + vertices_.alloc (objects.length); + vertices_scratch_.alloc (objects.length); for (unsigned i = 0; i < objects.length; i++) { // TODO(grieger): check all links point to valid objects.