From 70ac6dfb28e7ec921ab03467dd84e7c9103d87c5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 1 Dec 2022 14:56:28 -0700 Subject: [PATCH] [subset-cff] Don't memset 0 INDEX and other serialize methods Not necessary. --- src/hb-ot-cff-common.hh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index 3154bfc1f..08c5e9979 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -66,7 +66,7 @@ struct CFFIndex { TRACE_SERIALIZE (this); unsigned int size = get_size (); - CFFIndex *out = c->allocate_size (size); + CFFIndex *out = c->allocate_size (size, false); if (likely (out)) hb_memcpy (out, this, size); return_trace (out); @@ -90,7 +90,7 @@ struct CFFIndex if (unlikely (!c->extend_min (this))) return_trace (false); this->count = byteArray.length; this->offSize = offSize_; - if (unlikely (!c->allocate_size (offSize_ * (byteArray.length + 1)))) + if (unlikely (!c->allocate_size (offSize_ * (byteArray.length + 1), false))) return_trace (false); /* serialize indices */ @@ -107,7 +107,7 @@ struct CFFIndex for (unsigned int i = 0; i < byteArray.length; i++) { const hb_ubytes_t &bs = byteArray[i]; - unsigned char *dest = c->allocate_size (bs.length); + unsigned char *dest = c->allocate_size (bs.length, false); if (unlikely (!dest)) return_trace (false); hb_memcpy (dest, &bs[0], bs.length); } @@ -285,7 +285,7 @@ struct CFFIndexOf : CFFIndex if (unlikely (!c->extend_min (this))) return_trace (false); this->count = dataArrayLen; this->offSize = offSize_; - if (unlikely (!c->allocate_size (offSize_ * (dataArrayLen + 1)))) + if (unlikely (!c->allocate_size (offSize_ * (dataArrayLen + 1), false))) return_trace (false); /* serialize indices */ @@ -334,7 +334,7 @@ struct Dict : UnsizedByteStr TRACE_SERIALIZE (this); /* serialize the opcode */ - HBUINT8 *p = c->allocate_size (OpCode_Size (op)); + HBUINT8 *p = c->allocate_size (OpCode_Size (op), false); if (unlikely (!p)) return_trace (false); if (Is_OpCode_ESC (op)) { @@ -510,7 +510,7 @@ struct FDSelect { TRACE_SERIALIZE (this); unsigned int size = src.get_size (num_glyphs); - FDSelect *dest = c->allocate_size (size); + FDSelect *dest = c->allocate_size (size, false); if (unlikely (!dest)) return_trace (false); hb_memcpy (dest, &src, size); return_trace (true);