mirror of
https://github.com/apache/nuttx.git
synced 2025-05-09 06:42:10 +08:00
mm/mm_memalign: add debugging log
This adds debugging log support for mm_memalign to help track memory issues via logs. Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
parent
befe29801f
commit
f6facf7602
@ -27,6 +27,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
#include <nuttx/mm/mm.h>
|
#include <nuttx/mm/mm.h>
|
||||||
#include <nuttx/mm/kasan.h>
|
#include <nuttx/mm/kasan.h>
|
||||||
@ -287,5 +288,7 @@ FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment,
|
|||||||
alignedchunk = (uintptr_t)kasan_unpoison((FAR const void *)alignedchunk,
|
alignedchunk = (uintptr_t)kasan_unpoison((FAR const void *)alignedchunk,
|
||||||
size - MM_ALLOCNODE_OVERHEAD);
|
size - MM_ALLOCNODE_OVERHEAD);
|
||||||
DEBUGASSERT(alignedchunk % alignment == 0);
|
DEBUGASSERT(alignedchunk % alignment == 0);
|
||||||
|
minfo("Aligned %"PRIxPTR" to %"PRIxPTR", size %zu\n",
|
||||||
|
rawchunk, alignedchunk, size);
|
||||||
return (FAR void *)alignedchunk;
|
return (FAR void *)alignedchunk;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user