diff --git a/Source/portable/MemMang/heap_1.c b/Source/portable/MemMang/heap_1.c index 3e32fc013..1829d8a11 100644 --- a/Source/portable/MemMang/heap_1.c +++ b/Source/portable/MemMang/heap_1.c @@ -120,6 +120,16 @@ void *pvReturn = NULL; } } xTaskResumeAll(); + + #if( configUSE_MALLOC_FAILED_HOOK == 1 ) + { + if( pvReturn == NULL ) + { + extern void vApplicationMallocFailedHook( void ); + vApplicationMallocFailedHook(); + } + } + #endif return pvReturn; } diff --git a/Source/portable/MemMang/heap_2.c b/Source/portable/MemMang/heap_2.c index 7665f6904..b15c38467 100644 --- a/Source/portable/MemMang/heap_2.c +++ b/Source/portable/MemMang/heap_2.c @@ -230,6 +230,16 @@ void *pvReturn = NULL; } xTaskResumeAll(); + #if( configUSE_MALLOC_FAILED_HOOK == 1 ) + { + if( pvReturn == NULL ) + { + extern void vApplicationMallocFailedHook( void ); + vApplicationMallocFailedHook(); + } + } + #endif + return pvReturn; } /*-----------------------------------------------------------*/ diff --git a/Source/portable/MemMang/heap_3.c b/Source/portable/MemMang/heap_3.c index 6389783c5..763d0402d 100644 --- a/Source/portable/MemMang/heap_3.c +++ b/Source/portable/MemMang/heap_3.c @@ -74,6 +74,16 @@ void *pvReturn; } xTaskResumeAll(); + #if( configUSE_MALLOC_FAILED_HOOK == 1 ) + { + if( pvReturn == NULL ) + { + extern void vApplicationMallocFailedHook( void ); + vApplicationMallocFailedHook(); + } + } + #endif + return pvReturn; } /*-----------------------------------------------------------*/