arch/sim: enable heap management support on simulation platform #18077
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
The simulation platform previously used a custom heap implementation that
lacked support for standard memory management features. This prevented
the use of shared memory mechanisms and consistent heap
debugging across platforms.
This patch migrates arch/sim to use the standard umm_heap framework while
maintaining necessary platform-specific customizations. The changes enable:
Similar implementations exist in other platforms which use the umm_heap framework
with platform-specific hooks.
Impact
Testing
Host: Ubuntu 22.04 x86_64
Toolchain: gcc 11.4.0
Configuration: sim:nsh with
MM_UMM_CUSTOMIZE_MANAGERenabledCustom application testing
Created a test application (
hello) to verify heap functionality:Source Code
Build and Run
Output
Results
✅ malloc(100) returns valid pointer 0x401bcdf0
✅ Memory write p[50] = 'a' succeeds
✅ Memory read outputs correct value a
✅ free(p) executes without crash
✅ Application exits cleanly