mirror of https://github.com/thesofproject/sof.git
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:
parent
e92ef97834
commit
5972ac363d
|
@ -351,10 +351,17 @@ static void *rmalloc_runtime(uint32_t caps, size_t bytes)
|
||||||
struct mm_heap *heap;
|
struct mm_heap *heap;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
/* check runtime heap for capabilities */
|
||||||
heap = get_runtime_heap_from_caps(caps);
|
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)
|
if (heap == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
find:
|
||||||
for (i = 0; i < heap->blocks; i++) {
|
for (i = 0; i < heap->blocks; i++) {
|
||||||
|
|
||||||
/* is block big enough */
|
/* is block big enough */
|
||||||
|
|
Loading…
Reference in New Issue