mm: add memory pressure notification support

Add mm_heap_free interface to pass remaining memory to memory pressure

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai
2024-01-24 23:33:02 +08:00
committed by Xiang Xiao
parent f44a31c337
commit 49d1b4198f
10 changed files with 82 additions and 9 deletions
+13
View File
@@ -1463,3 +1463,16 @@ void mm_free_delaylist(FAR struct mm_heap_s *heap)
free_delaylist(heap, true);
}
}
/****************************************************************************
* Name: mm_heapfree
*
* Description:
* Return the total free size (in bytes) in the heap
*
****************************************************************************/
size_t mm_heapfree(FAR struct mm_heap_s *heap)
{
return heap->mm_heapsize - heap->mm_curused;
}