From 4b7b7a0a838bb9952d07025f02e84ca549a2753e Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Thu, 27 Oct 2022 10:54:19 +0100 Subject: [PATCH] shortcuts: Reduce SHORTCUTS_PER_HANDLE to 4 The current value of 32 per handle seems excessive. Buflib overhead per handle is only 20 bytes and a single shortcut is > 500 bytes. Reducing SHORTCUTS_PER_HANDLE means that minimum memory usage can be lower when there are a few shortcuts, at the cost of marginally increased usage for large numbers of shortcuts. This is helpful to keep memory usage under control for low-memory targets, where 16 KiB is almost 1% of system RAM! Change-Id: I47dbe0da874ae512cf50a0bd8350576ab2fabdf4 --- apps/shortcuts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/shortcuts.c b/apps/shortcuts.c index fd9d8d0949..85bf006646 100644 --- a/apps/shortcuts.c +++ b/apps/shortcuts.c @@ -80,7 +80,7 @@ struct shortcut { } timedata; } u; }; -#define SHORTCUTS_PER_HANDLE 32 +#define SHORTCUTS_PER_HANDLE 4 struct shortcut_handle { struct shortcut shortcuts[SHORTCUTS_PER_HANDLE]; int next_handle;