-
Notifications
You must be signed in to change notification settings - Fork 773
Open
Description
Overview
Add mem_allocator_malloc_aligned() API to support POSIX-compliant aligned memory allocation in the EMS allocator.
API
in mem-alloc/ems/
void *mem_allocator_malloc_aligned(mem_allocator_t allocator,
uint32_t size, uint32_t alignment);Key Features
- Supports alignments from 8 bytes to page size (powers of 2)
- Size must be multiple of alignment (POSIX requirement)
- Transparent free - mem_allocator_free() works for both normal and aligned allocations
- Realloc not supported for aligned allocations (returns NULL)
Implementation
- Over-allocation with metadata storage (8-byte header before returned pointer)
- Magic value detection in obj_to_hmu() for transparent free operation
- Full unit test suite with CMocka
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels