mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30381 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d0b72e2590
commit
baa070cca6
28 changed files with 865 additions and 298 deletions
|
@ -789,6 +789,8 @@ static const struct plugin_api rockbox_api = {
|
|||
|
||||
/* new stuff at the end, sort into place next time
|
||||
the API gets incompatible */
|
||||
tree_get_entries,
|
||||
tree_get_entry_at,
|
||||
};
|
||||
|
||||
int plugin_load(const char* plugin, const void* parameter)
|
||||
|
@ -865,6 +867,9 @@ int plugin_load(const char* plugin, const void* parameter)
|
|||
lcd_remote_update();
|
||||
#endif
|
||||
push_current_activity(ACTIVITY_PLUGIN);
|
||||
/* some plugins assume the entry cache doesn't move and save pointers to it
|
||||
* they should be fixed properly instead of this lock */
|
||||
tree_lock_cache(tree_get_context());
|
||||
|
||||
FOR_NB_SCREENS(i)
|
||||
viewportmanager_theme_enable(i, false, NULL);
|
||||
|
@ -879,6 +884,7 @@ int plugin_load(const char* plugin, const void* parameter)
|
|||
|
||||
rc = p_hdr->entry_point(parameter);
|
||||
|
||||
tree_unlock_cache(tree_get_context());
|
||||
pop_current_activity();
|
||||
|
||||
if (!pfn_tsr_exit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue