Skip to content
Commit 4690b8d5 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Anas Nashif
Browse files

libc/minimal: fix malloc() allocated memory alignment



The definition for malloc() says that it should return a pointer
to the allocated memory which is suitably aligned for any built-in
type. This requirement was lost in commit 0c15627c ("lib: Remove
sys_mem_pool implementation") where the entire memory pool used to
have an explicit alignment of 16.

Fix this by allocating memory with sys_heap_aligned_alloc() using
__alignof__(z_max_align_t) which will automatically get the needed
alignment on each platform.

Signed-off-by: default avatarNicolas Pitre <npitre@baylibre.com>
parent 6055c253
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment