1
0
Fork 0
forked from len0rd/rockbox

buflib: add a common dummy callbacks struct & use it

There are various allocations that can't be moved or shrunk.
Provide a global callback struct for this use case instead of
making each caller declare its own dummy struct.

Also fixed ROLO and x1000 installer code which incorrectly
used movable allocations.

Change-Id: I00088396b9826e02e69a4a33477fe1a7816374f1
This commit is contained in:
Aidan MacDonald 2022-01-18 18:57:06 +00:00
parent 95dfc489b5
commit e8faf2f2ad
14 changed files with 43 additions and 30 deletions

View file

@ -990,14 +990,11 @@ void* plugin_get_buffer(size_t *buffer_size)
*/
static void* plugin_get_audio_buffer(size_t *buffer_size)
{
/* dummy ops with no callbacks, needed because by
* default buflib buffers can be moved around which must be avoided */
static struct buflib_callbacks dummy_ops;
if (plugin_buffer_handle <= 0)
{
plugin_buffer_handle = core_alloc_maximum("plugin audio buf",
&plugin_buffer_size,
&dummy_ops);
&buflib_ops_locked);
}
if (buffer_size)