mm: Add CONFIG_MM_PANIC_ON_FAILURE option
While allocation failure here is not necessarily abnormal enough to warrant a panic in general, it can be useful in certain situations.
This commit is contained in:
parent
b05320cac2
commit
5edf5e5585
@ -201,4 +201,9 @@ config MM_DUMP_ON_FAILURE
|
||||
default n
|
||||
depends on DEBUG_MM
|
||||
|
||||
config MM_PANIC_ON_FAILURE
|
||||
bool "Panic on allocation failure"
|
||||
default n
|
||||
depends on DEBUG_MM
|
||||
|
||||
source "mm/iob/Kconfig"
|
||||
|
@ -255,6 +255,9 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
|
||||
minfo.arena, minfo.uordblks, minfo.fordblks,
|
||||
minfo.mxordblk, minfo.aordblks, minfo.ordblks);
|
||||
mm_memdump(heap, -1);
|
||||
#endif
|
||||
#ifdef CONFIG_MM_PANIC_ON_FAILURE
|
||||
PANIC();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user