alloc: rmalloc must check other zones/pools for capabilities

rmalloc should also check the buffer heap if no capable memory can be
found in the runtime heap.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
Liam Girdwood 2018-03-06 14:15:32 +00:00
parent e92ef97834
commit 5972ac363d
1 changed files with 7 additions and 0 deletions

View File

@ -351,10 +351,17 @@ static void *rmalloc_runtime(uint32_t caps, size_t bytes)
struct mm_heap *heap;
int i;
/* check runtime heap for capabilities */
heap = get_runtime_heap_from_caps(caps);
if (heap)
goto find;
/* next check buffer heap for capabilities */
heap = get_buffer_heap_from_caps(caps);
if (heap == NULL)
goto error;
find:
for (i = 0; i < heap->blocks; i++) {
/* is block big enough */