mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 13:01:57 -04:00
Declare vApplicationMallocFailedHook function in task.h instead in each C heap file (#483)
vApplicationMallocFailedHook was declared in each Heap file. which forces users to declare it and can cause problems if the prototype of the function changes. Co-authored-by: Pierre-Noel Bouteville <pnb990@gmail.com>
This commit is contained in:
parent
b00250372e
commit
e73fabce9a
1
.github/lexicon.txt
vendored
1
.github/lexicon.txt
vendored
|
@ -2476,6 +2476,7 @@ vapplicationgetidletaskmemory
|
|||
vapplicationgettimertaskmemory
|
||||
vapplicationidlehook
|
||||
vapplicationirqhandler
|
||||
vapplicationmallocfailedhook
|
||||
vapplicationsetuptickinterrupt
|
||||
vapplicationsetupticktimerinterrupt
|
||||
vapplicationsetuptimerinterrupt
|
||||
|
|
|
@ -188,6 +188,19 @@ size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
|||
#define vPortFreeStack vPortFree
|
||||
#endif
|
||||
|
||||
#if ( configUSE_MALLOC_FAILED_HOOK == 1 )
|
||||
|
||||
/**
|
||||
* task.h
|
||||
* @code{c}
|
||||
* void vApplicationMallocFailedHook( void )
|
||||
* @endcode
|
||||
*
|
||||
* This hook function is called when allocation failed.
|
||||
*/
|
||||
void vApplicationMallocFailedHook( void ); /*lint !e526 Symbol not defined as it is an application callback. */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Setup the hardware ready for the scheduler to take control. This generally
|
||||
* sets up a tick interrupt and sets timers for the correct tick frequency.
|
||||
|
|
|
@ -118,7 +118,6 @@ void * pvPortMalloc( size_t xWantedSize )
|
|||
{
|
||||
if( pvReturn == NULL )
|
||||
{
|
||||
extern void vApplicationMallocFailedHook( void );
|
||||
vApplicationMallocFailedHook();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -249,7 +249,6 @@ void * pvPortMalloc( size_t xWantedSize )
|
|||
{
|
||||
if( pvReturn == NULL )
|
||||
{
|
||||
extern void vApplicationMallocFailedHook( void );
|
||||
vApplicationMallocFailedHook();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,6 @@ void * pvPortMalloc( size_t xWantedSize )
|
|||
{
|
||||
if( pvReturn == NULL )
|
||||
{
|
||||
extern void vApplicationMallocFailedHook( void );
|
||||
vApplicationMallocFailedHook();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -269,7 +269,6 @@ void * pvPortMalloc( size_t xWantedSize )
|
|||
{
|
||||
if( pvReturn == NULL )
|
||||
{
|
||||
extern void vApplicationMallocFailedHook( void );
|
||||
vApplicationMallocFailedHook();
|
||||
}
|
||||
else
|
||||
|
|
|
@ -279,7 +279,6 @@ void * pvPortMalloc( size_t xWantedSize )
|
|||
{
|
||||
if( pvReturn == NULL )
|
||||
{
|
||||
extern void vApplicationMallocFailedHook( void );
|
||||
vApplicationMallocFailedHook();
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue