summaryrefslogtreecommitdiff
path: root/apps/menus
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-11-17 17:55:02 +0000
committerThomas Martitz <kugel@rockbox.org>2011-11-17 17:55:02 +0000
commit2a8eacdbfc5d98b016c480ddaddff100301f721f (patch)
tree69c79430463bb43c0e3ce96fbef851de6c35b277 /apps/menus
parent91206954aa0818e0790857f25f46a53d8e737a20 (diff)
downloadrockbox-2a8eacdbfc5d98b016c480ddaddff100301f721f.tar.gz
rockbox-2a8eacdbfc5d98b016c480ddaddff100301f721f.zip
Buflib: Make shrinking and buflib_available() smarter.
* shrinking now considers freespace just before the alloc-to-be-shrinked, that means less (or sometimes none at all) is taken from the audio buffer. * core_available() now searches for the best free space, instead of simply the end, i.e. it will not return 0 if the audio buffer is allocated and there's free space before it. It also runs a compaction to ensure maximum contiguous memory. audio_buffer_available() is also enhanced. It now considers the 256K reserve buffer, and returns free buflib space instead if the audio buffer is short. This all fixes the root problem of FS#12344 (Sansa Clip+: PANIC occurred when dircache is enabled), that alloced from the audio buffer, even if it was very short and buflib had many more available as free space before it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31006 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menus')
-rw-r--r--apps/menus/main_menu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 8053bf0cf8..bb8ea276fb 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -179,7 +179,7 @@ static const char* info_getname(int selected_item, void *data,
179 179
180 case INFO_BUFFER: /* buffer */ 180 case INFO_BUFFER: /* buffer */
181 { 181 {
182 long kib = audio_buffer_available() / 1024; /* to KiB */ 182 long kib = audio_buffer_size() / 1024; /* to KiB */
183 output_dyn_value(s1, sizeof(s1), kib, kbyte_units, true); 183 output_dyn_value(s1, sizeof(s1), kib, kbyte_units, true);
184 snprintf(buffer, buffer_len, "%s %s", str(LANG_BUFFER_STAT), s1); 184 snprintf(buffer, buffer_len, "%s %s", str(LANG_BUFFER_STAT), s1);
185 } 185 }
@@ -261,7 +261,7 @@ static int info_speak_item(int selected_item, void * data)
261 case INFO_BUFFER: /* buffer */ 261 case INFO_BUFFER: /* buffer */
262 { 262 {
263 talk_id(LANG_BUFFER_STAT, false); 263 talk_id(LANG_BUFFER_STAT, false);
264 long kib = audio_buffer_available() / 1024; /* to KiB */ 264 long kib = audio_buffer_size() / 1024; /* to KiB */
265 output_dyn_value(NULL, 0, kib, kbyte_units, true); 265 output_dyn_value(NULL, 0, kib, kbyte_units, true);
266 break; 266 break;
267 } 267 }