You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
FreeRTOS-Kernel/include
Gaurav-Aggarwal-AWS 82be77995e
Heap improvements (#462)
* Heap improvements

This commit makes the following improvements:

1. Add a check to heap_2 to track if a memory block is allocated to the
   application or not. The MSB of the size field is used for this
   purpose. The same check already exists in heap_4 and heap_5. This
   check prevents against double free.

2. Add a new flag configHEAP_CLEAR_MEMORY_ON_FREE to heap_2, heap_4 and
   heap_5. The application writer can set it to 1 in their
   FreeRTOSConfig.h to ensure that a block of memory allocated using
   pvPortMalloc is cleared (i.e. set to zero) when it is freed using
   vPortFree. If left undefined, configHEAP_CLEAR_MEMORY_ON_FREE
   defaults to 0 for backward compatibility. We recommend setting
   configHEAP_CLEAR_MEMORY_ON_FREE to 1 for better security.

3. Add a new API pvPortCalloc to heap_2, heap_4 and heap_5. This API
   has the following signature:
   void * pvPortCalloc( size_t xNum, size_t xSize );
   It allocates memory for an array of xNum objects each of which is of
   xSize and initializes all bytes in the allocated storage to zero. If
   allocation succeeds, it returns a pointer to the lowest byte in the
   allocated memory block. On failure, it returns a null pointer.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
3 years ago
..
FreeRTOS.h Add configUSE_MINI_LIST_ITEM configuration option to enable the MiniListItem_t type. (#433) 3 years ago
StackMacros.h Fix warning message error. (#443) 3 years ago
atomic.h Normalize files with mixed line endings (introduced in commit 3a413d1) 4 years ago
croutine.h Replace <pre> with @code - remaining files (#388) 3 years ago
deprecated_definitions.h Normalize files with mixed line endings (introduced in commit 3a413d1) 4 years ago
event_groups.h Fix some warnings in doxygen comments (#453) 3 years ago
list.h Add configUSE_MINI_LIST_ITEM configuration option to enable the MiniListItem_t type. (#433) 3 years ago
message_buffer.h Clean some spell check words. (#439) 3 years ago
mpu_prototypes.h Run uncrustify with github workflows (#369) 4 years ago
mpu_wrappers.h Fix formatting error 3 years ago
portable.h Heap improvements (#462) 3 years ago
projdefs.h Normalize files with mixed line endings (introduced in commit 3a413d1) 4 years ago
queue.h Fix typo (#454) 3 years ago
semphr.h Clean some spell check words. (#439) 3 years ago
stack_macros.h Run uncrustify with github workflows (#369) 4 years ago
stdint.readme Normalize files with mixed line endings (introduced in commit 3a413d1) 4 years ago
stream_buffer.h Clean some spell check words. (#439) 3 years ago
task.h Update documentation of uxTaskGetTaskNumber function (#460) 3 years ago
timers.h Clean some spell check words. (#439) 3 years ago