* src/autofit/afglobal.c (af_face_globals_new): Reduce zeroing.

Everything in AF_FaceGlobals is initialized except metrics.  Those
are zeroed here and initialized on demand later.
This commit is contained in:
Alexei Podtelezhnikov 2022-01-18 14:05:46 -05:00
parent d118bf8e35
commit 773e31c783
1 changed files with 5 additions and 3 deletions

View File

@ -337,11 +337,13 @@
/* we allocate an AF_FaceGlobals structure together */
/* with the glyph_styles array */
if ( FT_ALLOC( globals,
sizeof ( *globals ) +
(FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) )
if ( FT_QALLOC( globals,
sizeof ( *globals ) +
(FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) )
goto Exit;
FT_ZERO( &globals->metrics );
globals->face = face;
globals->glyph_count = face->num_glyphs;
/* right after the globals structure come the glyph styles */