Microchip® Advanced Software Framework

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

Data Structures

struct  A_BLOCK_LINK
 

Macros

#define configADJUSTED_HEAP_SIZE   ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )
 
#define heapMINIMUM_BLOCK_SIZE   ( ( size_t ) ( heapSTRUCT_SIZE * 2 ) )
 
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
 
#define prvInsertBlockIntoFreeList(pxBlockToInsert)
 

Typedefs

typedef struct A_BLOCK_LINK xBlockLink
 

Functions

static void prvHeapInit (void)
 
void * pvPortMalloc (size_t xWantedSize)
 
void vPortFree (void *pv)
 
void vPortInitialiseBlocks (void)
 
size_t xPortGetFreeHeapSize (void)
 

Variables

static const unsigned short heapSTRUCT_SIZE = ( ( sizeof ( xBlockLink ) + ( portBYTE_ALIGNMENT - 1 ) ) & ~portBYTE_ALIGNMENT_MASK )
 
static unsigned char ucHeap [configTOTAL_HEAP_SIZE]
 
static xBlockLink xEnd
 
static size_t xFreeBytesRemaining = configADJUSTED_HEAP_SIZE
 
static xBlockLink xStart
 

#define configADJUSTED_HEAP_SIZE   ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )

Referenced by prvHeapInit(), and pvPortMalloc().

#define heapMINIMUM_BLOCK_SIZE   ( ( size_t ) ( heapSTRUCT_SIZE * 2 ) )

Referenced by pvPortMalloc().

#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#define prvInsertBlockIntoFreeList (   pxBlockToInsert)
Value:
{ \
xBlockLink *pxIterator; \
size_t xBlockSize; \
\
xBlockSize = pxBlockToInsert->xBlockSize; \
\
/* Iterate through the list until a block is found that has a larger size */ \
/* than the block we are inserting. */ \
for( pxIterator = &xStart; pxIterator->pxNextFreeBlock->xBlockSize < xBlockSize; pxIterator = pxIterator->pxNextFreeBlock ) \
{ \
/* There is nothing to do here - just iterate to the correct position. */ \
} \
\
/* Update the list to include the block being inserted in the correct */ \
/* position. */ \
pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock; \
pxIterator->pxNextFreeBlock = pxBlockToInsert; \
}
static xBlockLink xStart
Definition: freertos-7.5.2/Source/portable/MemMang/heap_2.c:110
struct A_BLOCK_LINK * pxNextFreeBlock
Definition: freertos-10.0.0/Source/portable/MemMang/heap_2.c:76
struct A_BLOCK_LINK xBlockLink
static for(s->u.count=0;s->u.count< UIP_CONNS;++s->u.count)
Definition: httpd-cgi.c:232
size_t xBlockSize
Definition: freertos-10.0.0/Source/portable/MemMang/heap_2.c:77

Referenced by pvPortMalloc(), and vPortFree().

typedef struct A_BLOCK_LINK xBlockLink

static void prvHeapInit ( void  )
static
void vPortInitialiseBlocks ( void  )
size_t xPortGetFreeHeapSize ( void  )

References xFreeBytesRemaining.

const unsigned short heapSTRUCT_SIZE = ( ( sizeof ( xBlockLink ) + ( portBYTE_ALIGNMENT - 1 ) ) & ~portBYTE_ALIGNMENT_MASK )
static

Referenced by pvPortMalloc(), and vPortFree().

unsigned char ucHeap[configTOTAL_HEAP_SIZE]
static

Referenced by prvHeapInit().

xBlockLink xEnd
static

Referenced by prvHeapInit().

size_t xFreeBytesRemaining = configADJUSTED_HEAP_SIZE
static

Referenced by xPortGetFreeHeapSize().

xBlockLink xStart
static

Referenced by pvPortMalloc().