GSoC/Buflib: Enable compaction in buflib.gsoc2-buflib-compaction-flat
commit9d4689e5cc9830fb0382474ed22da528e4826d19
authorThomas Martitz <kugel@rockbox.org>
Mon, 15 Aug 2011 15:54:16 +0000 (15 17:54 +0200)
committerThomas Martitz <kugel@rockbox.org>
Mon, 15 Aug 2011 15:54:16 +0000 (15 17:54 +0200)
tree8dbc29ea52951787c721a30268b026a1c3136123
parentb0df565e0e4e90bbe6822306b28e3ea737f0ce94
GSoC/Buflib: Enable compaction in buflib.

This enables the ability to allocate (and free) memory dynamically
without fragmentation, through compaction. This means allocations can move
and fragmentation be reduced. Most changes are preparing Rockbox for this,
which many times means adding a move callback which can temporarily disable
movement when the corresponding code is in a critical section.

For now, the audio buffer allocation has a central role, because it's the one
having allocated most. This buffer is able to shrink itself, for which it
needs to stop playback for a very short moment. For this,
audio_buffer_available() returns the size of the audio buffer which can
possibly be used by other allocations because the audio buffer can shrink.

lastfm scrobbling and timestretch can now be toggled at runtime without
requiring a reboot.
30 files changed:
apps/debug_menu.c
apps/dsp.c
apps/filetree.c
apps/filetypes.c
apps/main.c
apps/menus/playback_menu.c
apps/mpeg.c
apps/playback.c
apps/playlist.c
apps/playlist.h
apps/plugin.c
apps/plugin.h
apps/plugins/imageviewer/imageviewer.c
apps/plugins/mikmod/mikmod.c
apps/plugins/mpegplayer/mpegplayer.c
apps/plugins/rockpaint.c
apps/scrobbler.c
apps/tagcache.c
apps/tagcache.h
apps/tagtree.c
apps/tagtree.h
apps/talk.c
apps/tdspeed.c
apps/tdspeed.h
apps/tree.c
apps/tree.h
firmware/buflib.c
firmware/common/dircache.c
firmware/core_alloc.c
firmware/include/core_alloc.h