Microchip® Advanced Software Framework

freertos-8.2.3/Source/portable/MemMang/heap_4.c File Reference
#include <stdlib.h>
#include "FreeRTOS.h"
#include "task.h"

Data Structures

struct  A_BLOCK_LINK
 

Macros

#define heapBITS_PER_BYTE   ( ( size_t ) 8 )
 
#define heapMINIMUM_BLOCK_SIZE   ( ( size_t ) ( xHeapStructSize << 1 ) )
 
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
 

Typedefs

typedef struct A_BLOCK_LINK BlockLink_t
 

Functions

static void prvHeapInit (void)
 
static void prvInsertBlockIntoFreeList (BlockLink_t *pxBlockToInsert)
 
void * pvPortMalloc (size_t xWantedSize)
 
void vApplicationMallocFailedHook (void)
 
void vPortFree (void *pv)
 
void vPortInitialiseBlocks (void)
 
size_t xPortGetFreeHeapSize (void)
 
size_t xPortGetMinimumEverFreeHeapSize (void)
 

Variables

static BlockLink_tpxEnd = NULL
 
static uint8_t ucHeap [configTOTAL_HEAP_SIZE]
 
static size_t xBlockAllocatedBit = 0
 
static size_t xFreeBytesRemaining = 0U
 
static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK )
 
static size_t xMinimumEverFreeBytesRemaining = 0U
 
static BlockLink_t xStart
 

#define heapBITS_PER_BYTE   ( ( size_t ) 8 )

Referenced by prvHeapInit().

#define heapMINIMUM_BLOCK_SIZE   ( ( size_t ) ( xHeapStructSize << 1 ) )

Referenced by pvPortMalloc().

#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE

typedef struct A_BLOCK_LINK BlockLink_t

static void prvInsertBlockIntoFreeList ( BlockLink_t pxBlockToInsert)
static
void vApplicationMallocFailedHook ( void  )

vApplicationMallocFailedHook() will only be called if configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook function that will get called if a call to pvPortMalloc() fails. pvPortMalloc() is called internally by the kernel whenever a task, queue, timer or semaphore is created. It is also called by various parts of the demo application. If heap_1.c or heap_2.c are used, then the size of the heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used to query the size of free heap space that remains (although it does not provide information on how the remaining heap might be fragmented).

vApplicationMallocFailedHook() will only be called if configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook function that will get called if a call to pvPortMalloc() fails. pvPortMalloc() is called internally by the kernel whenever a task, queue, timer or semaphore is created. It is also called by various parts of the demo application. If heap_1.c or heap_2.c are used, then the size of the heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used to query the size of free heap space that remains (although it does not provide information on how the remaining heap might be fragmented).

vApplicationMallocFailedHook() will only be called if configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook function that will get called if a call to pvPortMalloc() fails. pvPortMalloc() is called internally by the kernel whenever a task, queue, timer or semaphore is created. It is also called by various parts of the demo application. If heap_1.c or heap_2.c are used, then the size of the heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used to query the size of free heap space that remains (although it does not provide information on how the remaining heap might be fragmented).

vApplicationMallocFailedHook() will only be called if configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook function that will get called if a call to pvPortMalloc() fails. pvPortMalloc() is called internally by the kernel whenever a task, queue, timer or semaphore is created. It is also called by various parts of the demo application. If heap_1.c or heap_2.c are used, then the size of the heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used to query the size of free heap space that remains (although it does not provide information on how the remaining heap might be fragmented).

vApplicationMallocFailedHook() will only be called if configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook function that will get called if a call to pvPortMalloc() fails. pvPortMalloc() is called internally by the kernel whenever a task, queue, timer or semaphore is created. It is also called by various parts of the demo application. If heap_1.c or heap_2.c are used, then the size of the heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used to query the size of free heap space that remains (although it does not provide information on how the remaining heap might be fragmented).

References configASSERT, and NULL.

Referenced by pvPortMalloc().

void vPortInitialiseBlocks ( void  )

References xNextFreeByte.

size_t xPortGetFreeHeapSize ( void  )

References xFreeBytesRemaining.

size_t xPortGetMinimumEverFreeHeapSize ( void  )

BlockLink_t * pxEnd = NULL
static
uint8_t ucHeap[configTOTAL_HEAP_SIZE]
static

Referenced by prvHeapInit().

size_t xBlockAllocatedBit = 0
static

Referenced by pvPortMalloc().

size_t xFreeBytesRemaining = 0U
static
const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK )
static
size_t xMinimumEverFreeBytesRemaining = 0U
static
BlockLink_t xStart
static

Referenced by pvPortMalloc().