mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user