summaryrefslogtreecommitdiff
path: root/src/xftdraw.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2022-06-27 03:54:58 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2022-07-06 04:27:36 -0400
commit442bbb084a1316aa6b25b29e17889bc71c1e4235 (patch)
tree787bcd2134d6b58b43ba35a3a400fb6a876b7587 /src/xftdraw.c
parentd4a554c9795b109085ec31eedacba6532c18d802 (diff)
downloadxorg-lib-libXft-442bbb084a1316aa6b25b29e17889bc71c1e4235.tar.gz
add "trackmemusage" property to use in improved _XftFontUncacheGlyph
The linear search used for randomly selecting a glyph to discard is inefficient. This commit provides for a doubly-linked list which could be maintained by the library to quickly discard the least recently used glyph. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/xftdraw.c')
-rw-r--r--src/xftdraw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/xftdraw.c b/src/xftdraw.c
index 4054714..c77cdee 100644
--- a/src/xftdraw.c
+++ b/src/xftdraw.c
@@ -132,7 +132,7 @@ XftDrawCreate (Display *dpy,
{
XftDraw *draw;
- draw = (XftDraw *) malloc (sizeof (XftDraw));
+ draw = malloc (sizeof (XftDraw));
if (!draw)
return NULL;
@@ -158,7 +158,7 @@ XftDrawCreateBitmap (Display *dpy,
{
XftDraw *draw;
- draw = (XftDraw *) malloc (sizeof (XftDraw));
+ draw = malloc (sizeof (XftDraw));
if (!draw)
return NULL;
draw->dpy = dpy;
@@ -184,7 +184,7 @@ XftDrawCreateAlpha (Display *dpy,
{
XftDraw *draw;
- draw = (XftDraw *) malloc (sizeof (XftDraw));
+ draw = malloc (sizeof (XftDraw));
if (!draw)
return NULL;
draw->dpy = dpy;