mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-10 08:07:46 -04:00
Implemented configUSE_MALLOC_FAILED_HOOK
Thank You very much, Johnny!
This commit is contained in:
parent
4a4d0e4c39
commit
d024d75ce4
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue