From d024d75ce4e7e07be2cf91edf115c2c2998ed449 Mon Sep 17 00:00:00 2001 From: Sven Bieg Date: Tue, 16 Apr 2024 18:06:31 +0200 Subject: [PATCH] Implemented configUSE_MALLOC_FAILED_HOOK Thank You very much, Johnny! --- portable/MemMang/heap_6.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/portable/MemMang/heap_6.c b/portable/MemMang/heap_6.c index 0a1b504de..2360d5782 100644 --- a/portable/MemMang/heap_6.c +++ b/portable/MemMang/heap_6.c @@ -115,10 +115,6 @@ else { buf=heap_alloc_from_foot(heap, size); } -#if(configUSE_MALLOC_FAILED_HOOK==1) -if(buf==NULL) - vApplicationMallocFailedHook(); -#endif return buf; } @@ -1779,6 +1775,10 @@ if(locked) heap_unlock(locked); if(buf!=NULL) xSuccessfulAllocations++; +#if(configUSE_MALLOC_FAILED_HOOK==1) +if(buf==NULL) + vApplicationMallocFailedHook(); +#endif return buf; }