From 32d52e0415771ac8a21ae222d4700223d6f26497 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 12 Sep 2025 23:00:14 -0400 Subject: [PATCH] hosted: Shrink audiobuffer to (MEMORY_SIZE-1) megabytes This represents a 256K increase from the former (MEMORYSIZE-0.75), and is necessary due to the growth in our binary sizes over the past decade or so. It is debatable if this is enough given that our actual memory usage is approximately (MEMORYSIZE+3) megabytes (plus runtime OS overhead) for the typical hosted build, but giving the host OS a bit more breathing room is warranted. Change-Id: I53e044585a32efd50a85e68d64fd21921eda01a3 --- firmware/core_alloc.c | 3 +-- tools/configure | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/firmware/core_alloc.c b/firmware/core_alloc.c index 948911b973..5f3622a1e5 100644 --- a/firmware/core_alloc.c +++ b/firmware/core_alloc.c @@ -30,9 +30,8 @@ extern unsigned char audiobufend[]; #endif #else /* PLATFORM_HOSTED */ -static unsigned char audiobuffer[((MEMORYSIZE)*1024-768)*1024]; +static unsigned char audiobuffer[(MEMORYSIZE-1)*1024*1024]; unsigned char *audiobufend = audiobuffer + sizeof(audiobuffer); -extern unsigned char *audiobufend; #endif #ifdef BUFLIB_DEBUG_PRINT diff --git a/tools/configure b/tools/configure index bc1e08ccb6..e4df896850 100755 --- a/tools/configure +++ b/tools/configure @@ -1816,8 +1816,9 @@ fi # modelname: short model name used all over to identify this target # memory: number of megabytes of RAM this target has. If the amount can # be selected by the size prompt, let memory be unset here - # Note that for hsoted/application builds, this is the size - # reserved for the audio buffer, not the total RAM size. + # Note for hosted/application builds, (memory-1) defines the + # audiobuffer size; actual memory usage will likely be + # larger and is found in rockbox-info.txt after compilation. # target: -Ddefine passed to the build commands to make the correct # config-*.h file get included etc # tool: the tool that takes a plain binary and converts that into a