This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
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>
2022-02-24 10:52:10 -08:00
..
atomic.h Normalize files with mixed line endings (introduced in commit 3a413d1) 2021-06-01 17:55:18 -07:00
croutine.h Replace <pre> with @code - remaining files (#388) 2021-09-07 12:03:12 -07:00
deprecated_definitions.h Normalize files with mixed line endings (introduced in commit 3a413d1) 2021-06-01 17:55:18 -07:00
event_groups.h Fix some warnings in doxygen comments (#453) 2022-02-10 11:36:42 -08:00
FreeRTOS.h Add configUSE_MINI_LIST_ITEM configuration option to enable the MiniListItem_t type. (#433) 2022-01-19 13:12:57 -08:00
list.h Add configUSE_MINI_LIST_ITEM configuration option to enable the MiniListItem_t type. (#433) 2022-01-19 13:12:57 -08:00
message_buffer.h Clean some spell check words. (#439) 2022-01-07 10:45:58 -08:00
mpu_prototypes.h Run uncrustify with github workflows (#369) 2021-07-28 17:53:10 -07:00
mpu_wrappers.h Fix formatting error 2021-11-15 15:09:12 -08:00
portable.h Heap improvements (#462) 2022-02-24 10:52:10 -08:00
projdefs.h Normalize files with mixed line endings (introduced in commit 3a413d1) 2021-06-01 17:55:18 -07:00
queue.h Fix typo (#454) 2022-02-13 15:47:52 -08:00
semphr.h Clean some spell check words. (#439) 2022-01-07 10:45:58 -08:00
stack_macros.h Run uncrustify with github workflows (#369) 2021-07-28 17:53:10 -07:00
StackMacros.h Fix warning message error. (#443) 2022-01-21 10:10:22 -08:00
stdint.readme Normalize files with mixed line endings (introduced in commit 3a413d1) 2021-06-01 17:55:18 -07:00
stream_buffer.h Clean some spell check words. (#439) 2022-01-07 10:45:58 -08:00
task.h Update documentation of uxTaskGetTaskNumber function (#460) 2022-02-22 10:44:05 -08:00
timers.h Clean some spell check words. (#439) 2022-01-07 10:45:58 -08:00