File heap_4.c
FileList > neuralSPOT > neuralspot > ns-core > src > heap_4.c
Go to the source code of this file
#include <stdlib.h>
#include "FreeRTOS.h"
#include "task.h"
Classes
Public Types
Public Attributes
Type |
Name |
size_t const |
ucHeapSize = = configTOTAL_HEAP_SIZE
|
Public Static Attributes
Public Functions
Public Static Functions
Macros
Public Types Documentation
typedef BlockLink_t
typedef struct A_BLOCK_LINK BlockLink_t;
Public Attributes Documentation
variable ucHeapSize
Public Static Attributes Documentation
variable pxEnd
variable xBlockAllocatedBit
size_t xBlockAllocatedBit;
variable xFreeBytesRemaining
size_t xFreeBytesRemaining;
variable xHeapStructSize
const size_t xHeapStructSize;
variable xMinimumEverFreeBytesRemaining
size_t xMinimumEverFreeBytesRemaining;
variable xStart
Public Functions Documentation
function prvPortFree
void prvPortFree (
void * pv,
uint8_t enableSuspendResume
)
function prvPortMalloc
void * prvPortMalloc (
size_t xWantedSize,
uint8_t enableSuspendResume
)
pvPortMalloc has a bug where it assumes that the task scheduler is running: The culprit is ResumeAll, which calls enterCritical/exitCritical - these functions, in port.c, assume the task scheduler is running, and the exit is not enabling interrupts because of the nested critical assert.
NeuralSPOT solution is to create a new version of malloc
function pvPortMalloc
void * pvPortMalloc (
size_t xWantedSize
)
function pvTasklessPortMalloc
void * pvTasklessPortMalloc (
size_t xWantedSize
)
function vPortFree
void vPortFree (
void * pv
)
function vPortInitialiseBlocks
void vPortInitialiseBlocks (
void
)
function vTasklessPortFree
void vTasklessPortFree (
void * pv
)
function xPortGetFreeHeapSize
size_t xPortGetFreeHeapSize (
void
)
function xPortGetMinimumEverFreeHeapSize
size_t xPortGetMinimumEverFreeHeapSize (
void
)
Public Static Functions Documentation
function __attribute__
static uint8_t ucHeap[configTOTAL_HEAP_SIZE] __attribute__ (
(aligned(4))
)
function prvHeapInit
static void prvHeapInit (
void
)
function prvInsertBlockIntoFreeList
static void prvInsertBlockIntoFreeList (
BlockLink_t * pxBlockToInsert
)
Macro Definition Documentation
define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
define configTOTAL_HEAP_SIZE
#define configTOTAL_HEAP_SIZE NS_MALLOC_HEAP_SIZE_IN_K * 1024
define heapBITS_PER_BYTE
#define heapBITS_PER_BYTE ((size_t)8)
define heapMINIMUM_BLOCK_SIZE
#define heapMINIMUM_BLOCK_SIZE ((size_t)(xHeapStructSize << 1))
The documentation for this class was generated from the following file neuralSPOT/neuralspot/ns-core/src/heap_4.c