feilipu / Arduino_FreeRTOS_Library

A FreeRTOS Library for all Arduino ATmega Devices (Uno R3, Leonardo, Mega, etc).
MIT License
852 stars 204 forks source link

Remove a slow parameter validation block #138

Closed neboskreb closed 1 month ago

neboskreb commented 1 month ago

This is alternative solution to feilipu/Arduino_FreeRTOS_Library#136

The validation block which contained a division operation is removed. In case of invalid parameters, the allocation properly fails at line 515 and the failure is detected on the next line:

            pxNewQueue = ( Queue_t * ) pvPortMalloc( sizeof( Queue_t ) + xQueueSizeInBytes );

            if( pxNewQueue != NULL )
            {
                ...
            }
            else
            {
                traceQUEUE_CREATE_FAILED( ucQueueType );
                mtCOVERAGE_TEST_MARKER();
            }
neboskreb commented 1 month ago

Decided to go with the other one, #137. Closing.