-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove default behaviour of FREERTOS_HEAP. #807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
To build a complete static application (configSUPPORT_DYNAMIC_ALLOCATION set to 0) an ugly workaround is necessary, because when FREERTOS_HEAP is not set, heap 4 is automatically selected in the current CMake.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #807 +/- ##
=======================================
Coverage 93.64% 93.64%
=======================================
Files 6 6
Lines 2549 2549
Branches 608 608
=======================================
Hits 2387 2387
Misses 107 107
Partials 55 55
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hey, thanks for the PR! We're discussing what the best way to solve this issue is, and will get back to you. |
Can you give me an update on this point? |
Hi @conara, Thanks. |
Kudos, SonarCloud Quality Gate passed!
|
To build a complete static application (configSUPPORT_DYNAMIC_ALLOCATION set to 0) an ugly workaround is necessary, because when FREERTOS_HEAP is not set, heap 4 is automatically selected in the current CMake. Co-authored-by: kar-rahul-aws <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
To build a complete static application (configSUPPORT_DYNAMIC_ALLOCATION set to 0) an ugly workaround is necessary. When FREERTOS_HEAP (CMake variable) is not set, heap 4 is automatically selected in the current CMake. Without this change I got the following error:
/home/boris/workspace/base/external/freertos/portable/MemMang/heap_4.c:51:6: error: #error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0 51 | #error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0
For additional context, please read: https://forums.freertos.org/t/i-cannot-build-a-complete-static-application-bug-or-feature/9553
I opted to modify the default behavior of the FREERTOS_HEAP CMake variable because I believe it's essential for the user to be conscious of the chosen heap implementation. While another option was to introduce a magic variable to prevent automatic heap implementation selection, I find this approach to be the most straightforward and logical one.
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.