FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.51k stars 1.05k forks source link

Improve multiple accessing pxCurrentTCB in a function #1065

Open chinglee-iot opened 1 month ago

chinglee-iot commented 1 month ago

Description

Address Richard's feedback to update the usage of pxCurrentTCB in a function. Since pxCurrentTCB is a volatile variable, accessing it multiple times can be slow if this pointer is not changed.

In this PR:

Test Steps

Performance comparison test.

Checklist:

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

sonarcloud[bot] commented 1 month ago

Quality Gate Failed Quality Gate failed

Failed conditions
3.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud