Skip to content

feat(baremetal): implement PAL memory free support - #490

Merged
chetan-rathore merged 1 commit into
ARM-software:mainfrom
Sahil-Malpekar:mem_free
Aug 3, 2026
Merged

feat(baremetal): implement PAL memory free support#490
chetan-rathore merged 1 commit into
ARM-software:mainfrom
Sahil-Malpekar:mem_free

Conversation

@Sahil-Malpekar

Copy link
Copy Markdown
Contributor
  • Implement free-capable heap allocation for baremetal PAL memory APIs by replacing the previous bump-only heap behavior with allocator metadata, free-list tracking, and adjacent block coalescing.

  • Store per-allocation metadata so mem_free() can recover and validate the owning block, mark it free, and make the memory available for later allocations.

  • Route baremetal page and cacheable memory free paths through mem_free() so PAL allocation APIs have matching free handling.

  • Allow baremetal memory allocated through PAL helpers to be reused after free, reducing the risk of heap exhaustion across tests that allocate and release temporary buffers.

Change-Id: I9b34a26ae8d5fd7d72b82f0c0c1ed18eda0571f8

- Implement free-capable heap allocation for baremetal
  PAL memory APIs by replacing the previous bump-only
  heap behavior with allocator metadata, free-list
  tracking, and adjacent block coalescing.

- Store per-allocation metadata so mem_free() can recover
  and validate the owning block, mark it free, and make the
  memory available for later allocations.

- Route baremetal page and cacheable memory free paths
  through mem_free() so PAL allocation APIs have matching
  free handling.

- Allow baremetal memory allocated through PAL helpers to
  be reused after free, reducing the risk of heap exhaustion
  across tests that allocate and release temporary buffers.

Signed-off-by: Sahil Shakil Malpekar <Sahil.ShakilMalpekar@arm.com>
Change-Id: I9b34a26ae8d5fd7d72b82f0c0c1ed18eda0571f8
@chetan-rathore
chetan-rathore merged commit cafc899 into ARM-software:main Aug 3, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants