From f3a74c16ecafdca135a647ebe85117c35c1ef585 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Jul 2018 17:23:53 +0200 Subject: [PATCH] Make hb_vector_t 8 bytes smaller --- src/hb-dsalgs.hh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh index 953310bcd..fc7d1f0a9 100644 --- a/src/hb-dsalgs.hh +++ b/src/hb-dsalgs.hh @@ -450,8 +450,7 @@ template struct hb_vector_t { unsigned int len; - unsigned int allocated; - bool successful; + unsigned int allocated; /* == 0 means allocation failed. */ Type *arrayZ; Type static_array[StaticSize]; @@ -459,7 +458,6 @@ struct hb_vector_t { len = 0; allocated = ARRAY_LENGTH (static_array); - successful = true; arrayZ = static_array; } @@ -492,7 +490,7 @@ struct hb_vector_t /* Allocate for size but don't adjust len. */ inline bool alloc (unsigned int size) { - if (unlikely (!successful)) + if (unlikely (!allocated)) return false; if (likely (size <= allocated)) @@ -521,7 +519,7 @@ struct hb_vector_t if (unlikely (!new_array)) { - successful = false; + allocated = 0; return false; }