Skip to content

Feat: aligned allocation#4886

Merged
lum1n0us merged 8 commits into
bytecodealliance:mainfrom
lum1n0us:feat/aligned-allocation
Apr 18, 2026
Merged

Feat: aligned allocation#4886
lum1n0us merged 8 commits into
bytecodealliance:mainfrom
lum1n0us:feat/aligned-allocation

Conversation

@lum1n0us
Copy link
Copy Markdown
Contributor

@lum1n0us lum1n0us commented Mar 20, 2026

Please refer to core/shared/mem-alloc/ems/ems_gc_internal.h in PR to get more details about arch.

@lum1n0us lum1n0us force-pushed the feat/aligned-allocation branch 2 times, most recently from 6d08a77 to 21857a9 Compare March 27, 2026 02:44
@lum1n0us lum1n0us marked this pull request as ready for review March 30, 2026 07:11
@lum1n0us lum1n0us linked an issue Mar 31, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@TianlongLiang TianlongLiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first round review is on the source code. I will continue to review test cases

Comment thread core/iwasm/common/wasm_memory.c
Comment thread tests/unit/shared-utils/bh_queue_test.cc
Comment thread core/shared/mem-alloc/ems/ems_alloc.c Outdated
Comment thread core/shared/mem-alloc/ems/ems_alloc.c Outdated
Comment thread core/shared/mem-alloc/ems/ems_gc_internal.h Outdated
Comment thread core/shared/utils/bh_platform.h
Comment thread tests/unit/mem-alloc/mem_alloc_test.c Outdated
Comment thread tests/unit/mem-alloc/mem_alloc_test.c
Comment thread tests/unit/mem-alloc/mem_alloc_test.c
Comment thread tests/unit/mem-alloc/mem_alloc_test.c
lum1n0us and others added 8 commits April 16, 2026 09:00
Add public API for aligned memory allocation, exposing the existing
mem_allocator_malloc_aligned infrastructure through wasm_export.h.

- Add wasm_runtime_aligned_alloc() API declaration with documentation
- Implement internal helper wasm_runtime_aligned_alloc_internal()
- Add public function with size/alignment validation
- POOL mode only, returns NULL for other memory modes
- Follows wasm_runtime_malloc() patterns for consistency

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@lum1n0us lum1n0us force-pushed the feat/aligned-allocation branch from 8ae06b3 to 79494ce Compare April 16, 2026 05:48
@lum1n0us lum1n0us merged commit a5136e9 into bytecodealliance:main Apr 18, 2026
937 of 941 checks passed
@lum1n0us lum1n0us deleted the feat/aligned-allocation branch April 18, 2026 10:20
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.

Add aligned memory allocation API (aligned_alloc)

2 participants