Commit 07ccd49
fw/graphics: keep the glyph metadata SPI lookup inlined
35ff0d4 ("fw/graphics: consult the font's other own resource when
routed lookup misses") added a second call site for
prv_get_glyph_metadata_from_spi(), which stopped GCC from inlining it
into prv_get_glyph_in_font(): the glyph lookup path grew from one
64-byte frame to 40 + 64 bytes of nested frames.
This chain (graphics_draw_text -> walk_line -> text_resources_get_glyph
-> resource/pfs syscalls) is the deepest consumer of the app task's
2 KiB stack on non-emery/gabbro platforms, and the extra 40 bytes
pushed watchfaces already near the limit into the stack guard. On a
Pebble 2 Duo this presented as v4.33.1 "not sticking": the active
watchface overflowed on every boot seconds after launch, the fault
escalated to a reboot, and after three reboots the bootloader fell
back to PRF (the QR onboarding screen).
Mark prv_get_glyph_metadata_from_spi() ALWAYS_INLINE. With both call
sites inlined GCC overlaps their stack slots, restoring the pre-4.32.0
64-byte frame, and the merged function is slightly smaller (836 vs 878
bytes) than the outlined pair since the call overhead disappears.
Fixes FIRM-3949
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Joshua Jun <lets@throw.rocks>1 parent 5055310 commit 07ccd49
1 file changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
| |||
0 commit comments