Implemented configUSE_MALLOC_FAILED_HOOK

Thank You very much, Johnny!
This commit is contained in:
Sven Bieg 2024-04-16 18:06:31 +02:00
parent 4a4d0e4c39
commit d024d75ce4

View file

@ -115,10 +115,6 @@ else
{ {
buf=heap_alloc_from_foot(heap, size); buf=heap_alloc_from_foot(heap, size);
} }
#if(configUSE_MALLOC_FAILED_HOOK==1)
if(buf==NULL)
vApplicationMallocFailedHook();
#endif
return buf; return buf;
} }
@ -1779,6 +1775,10 @@ if(locked)
heap_unlock(locked); heap_unlock(locked);
if(buf!=NULL) if(buf!=NULL)
xSuccessfulAllocations++; xSuccessfulAllocations++;
#if(configUSE_MALLOC_FAILED_HOOK==1)
if(buf==NULL)
vApplicationMallocFailedHook();
#endif
return buf; return buf;
} }