diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2022-07-01 04:25:10 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2022-07-06 04:27:42 -0400 |
commit | 114db90eac2c0f32f6b662d916a5af6a8990bf36 (patch) | |
tree | 7a9ee5c06c7b79101377b29f5a2f8ac75d8e80e2 /src/xftfreetype.c | |
parent | 442bbb084a1316aa6b25b29e17889bc71c1e4235 (diff) | |
download | xorg-lib-libXft-114db90eac2c0f32f6b662d916a5af6a8990bf36.tar.gz |
add option for tracking glyph memory-usage on a linked list
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/xftfreetype.c')
-rw-r--r-- | src/xftfreetype.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/xftfreetype.c b/src/xftfreetype.c index 6a66442..fd0c483 100644 --- a/src/xftfreetype.c +++ b/src/xftfreetype.c @@ -779,7 +779,7 @@ XftFontOpenInfo (Display *dpy, size_t alloc_size; int ascent, descent, height; int i; - int num_glyphs; + FT_UInt num_glyphs; if (!info) return NULL; @@ -878,7 +878,7 @@ XftFontOpenInfo (Display *dpy, * Sometimes the glyphs are numbered 1..n, other times 0..n-1, * accept either numbering scheme by making room in the table */ - num_glyphs = (int)face->num_glyphs + 1; + num_glyphs = (FT_UInt)face->num_glyphs + 1; alloc_size = (sizeof (XftFontInt) + (size_t)num_glyphs * sizeof (XftGlyph *) + hash_value * sizeof (XftUcsHash)); @@ -980,6 +980,11 @@ XftFontOpenInfo (Display *dpy, memset (font->glyphs, '\0', (size_t)num_glyphs * sizeof (XftGlyph *)); font->num_glyphs = num_glyphs; /* + * Memory-usage tracking + */ + font->newest = FT_UINT_MAX; + font->total_inuse = 0; + /* * Unicode hash table information */ font->hash_table = (XftUcsHash *) (font->glyphs + font->num_glyphs); |