mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 09:07:46 -04:00
Merge branch 'master' into sync-microblaze-port
This commit is contained in:
commit
d2c04757b4
2 changed files with 13 additions and 2 deletions
3
queue.c
3
queue.c
|
@ -397,6 +397,9 @@ BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
|
||||||
/* Check for multiplication overflow. */
|
/* Check for multiplication overflow. */
|
||||||
configASSERT( ( uxItemSize == 0 ) || ( uxQueueLength == ( xQueueSizeInBytes / uxItemSize ) ) );
|
configASSERT( ( uxItemSize == 0 ) || ( uxQueueLength == ( xQueueSizeInBytes / uxItemSize ) ) );
|
||||||
|
|
||||||
|
/* Check for addition overflow. */
|
||||||
|
configASSERT( ( sizeof( Queue_t ) + xQueueSizeInBytes ) > xQueueSizeInBytes );
|
||||||
|
|
||||||
/* Allocate the queue and storage area. Justification for MISRA
|
/* Allocate the queue and storage area. Justification for MISRA
|
||||||
* deviation as follows: pvPortMalloc() always ensures returned memory
|
* deviation as follows: pvPortMalloc() always ensures returned memory
|
||||||
* blocks are aligned per the requirements of the MCU stack. In this case
|
* blocks are aligned per the requirements of the MCU stack. In this case
|
||||||
|
|
|
@ -258,8 +258,16 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
|
||||||
* this is a quirk of the implementation that means otherwise the free
|
* this is a quirk of the implementation that means otherwise the free
|
||||||
* space would be reported as one byte smaller than would be logically
|
* space would be reported as one byte smaller than would be logically
|
||||||
* expected. */
|
* expected. */
|
||||||
xBufferSizeBytes++;
|
if( xBufferSizeBytes < ( xBufferSizeBytes + 1 + sizeof( StreamBuffer_t ) ) )
|
||||||
pucAllocatedMemory = ( uint8_t * ) pvPortMalloc( xBufferSizeBytes + sizeof( StreamBuffer_t ) ); /*lint !e9079 malloc() only returns void*. */
|
{
|
||||||
|
xBufferSizeBytes++;
|
||||||
|
pucAllocatedMemory = ( uint8_t * ) pvPortMalloc( xBufferSizeBytes + sizeof( StreamBuffer_t ) ); /*lint !e9079 malloc() only returns void*. */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pucAllocatedMemory = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if( pucAllocatedMemory != NULL )
|
if( pucAllocatedMemory != NULL )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue