Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
This is a fix for the field heap_stats.reserved_size in the mbed heap statistics. With split heap, the heap can contain two heap areas. In this case, mbed_heap_size changes to be the 2nd heap, and mbed_heap_size_0 will become the first heap part.
The heap statistics did took that change into account, and always used mbed_heap_size for the total heap size.
This PR adds a variable mbed_heap_size_total to reflect the total size, regardless if one or two heaps are used.
Impact of changes
Heap functions are declared as weak, so a custom implementation could be used for even more heap areas or heap in external SDRAM. In this case, the variable mbed_heap_size_total must be calculated in software_init_hook() in mbed_boot_gcc_arm.c for a correct output in the heap statistics.
Migration actions required
Documentation
Pull request type
Test results
Reviewers