@@ 9,6 9,7 @@
#include <stddef.h>
#include <string.h>
+#include <stdlib.h>
#include "macros.h"
/**
@@ 118,6 119,11 @@ void *usermalloc(size_t xWantedSize)
BlockLink_t *pxBlock, *pxPreviousBlock, *pxNewBlockLink;
void *pvReturn = NULL;
+ // Preventing use of an allocator in an interrupt
+ if (isIRQ()) {
+ abort();
+ }
+
vTaskSuspendAll();
{
/* If this is the first call to malloc then the heap will require
@@ 288,6 294,11 @@ void userfree(void *pv)
uint8_t *puc = ( uint8_t * ) pv;
BlockLink_t *pxLink;
+ // Preventing use of an allocator in an interrupt
+ if (isIRQ()) {
+ abort();
+ }
+
if( pv != NULL )
{
/* The memory being freed will have an BlockLink_t structure immediately