tsimplify (greedy) font caching allocating a bit - st - [fork] customized build… | |
git clone git://src.adamsgaard.dk/st | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit ed68fe7dce2b21b4e0e595b99d47790e76812cb7 | |
parent 4e0135afeca43f5affe13d7269cb98e7ac526074 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Sun, 3 Mar 2019 11:29:43 +0100 | |
simplify (greedy) font caching allocating a bit | |
POSIX says: | |
"If ptr is a null pointer, realloc() shall be equivalent to malloc() for the | |
specified size." | |
Diffstat: | |
M x.c | 9 ++------- | |
1 file changed, 2 insertions(+), 7 deletions(-) | |
--- | |
diff --git a/x.c b/x.c | |
t@@ -1243,15 +1243,10 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Gly… | |
fontpattern = FcFontSetMatch(0, fcsets, 1, | |
fcpattern, &fcres); | |
- /* | |
- * Allocate memory for the new cache entry. | |
- */ | |
+ /* Allocate memory for the new cache entry. */ | |
if (frclen >= frccap) { | |
frccap += 16; | |
- if (!frc) | |
- frc = xmalloc(frccap * sizeof(Fontcach… | |
- else | |
- frc = xrealloc(frc, frccap * sizeof(Fo… | |
+ frc = xrealloc(frc, frccap * sizeof(Fontcache)… | |
} | |
frc[frclen].font = XftFontOpenPattern(xw.dpy, |