vm/map: fix shared maps allocated calculation#790
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the free memory calculation in vm/map.c by locking the map and iterating through all of its entries to subtract their sizes from the total map size. The review feedback points out that casting e->size to an int during this subtraction is unnecessary and risks integer truncation or overflow on systems with large mappings, suggesting direct subtraction instead.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
f1f1bd1 to
1c2621b
Compare
Implementation was overestimating allocated memory when map was fragmented. TASK: RTOS-1345
1c2621b to
9014bf3
Compare
Unit Test Results10 860 tests +275 10 190 ✅ +275 53m 3s ⏱️ +55s Results for commit 9014bf3. ± Comparison against base commit 57b3041. This pull request removes 3 and adds 278 tests. Note that renamed tests count towards both. |
Description
Implementation was overestimating allocated memory when map memory was fragmented.
TASK: RTOS-1345
Motivation and Context
The result is used in psh
mem -scommand.Types of changes
How Has This Been Tested?
Checklist:
Special treatment