From 4de25f70200a074f358938c1715a35422e968549 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 5 Sep 2025 19:57:51 -0400 Subject: [PATCH] font: glpyh_cache_load() is now NO_INLINE It is particularly stack-heavy (>1.25K, >2.25K with 32-bit unicode) Its only caller was font_load_ex() but that can be called recursively which _really_ blew up the stack. Change-Id: I211cd33ca3478b2bd01d3ddcf6c890399af2fb9c --- firmware/font.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/firmware/font.c b/firmware/font.c index bb63aa1fd0..f8a755168e 100644 --- a/firmware/font.c +++ b/firmware/font.c @@ -161,7 +161,7 @@ static inline unsigned char *buffer_from_handle(int handle) /* Font cache structures */ static void cache_create(struct font* pf); -static void glyph_cache_load(const char *font_path, struct font *pf); +static NO_INLINE void glyph_cache_load(const char *font_path, struct font *pf); /* End Font cache structures */ void font_init(void) @@ -948,7 +948,8 @@ static int ushortcmp(const void *a, const void *b) { return ((int)(*(unsigned short*)a - *(unsigned short*)b)); } -static void glyph_cache_load(const char *font_path, struct font *pf) + +static NO_INLINE void glyph_cache_load(const char *font_path, struct font *pf) { #define MAX_SORT 256 if (pf->fd >= 0) {