lib/os/heap: always assert the align value argument

Just like commit 0ae04f01b6 ("lib/os/heap: make some checks more
assertive") we shouldn't validate the externally provided align
argument only when CONFIG_SYS_HEAP_VALIDATE is set.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
Nicolas Pitre 2020-12-17 20:44:44 -05:00 committed by Andrew Boie
commit 36f075847c

View file

@ -248,7 +248,7 @@ void *sys_heap_aligned_alloc(struct sys_heap *heap, size_t align, size_t bytes)
{ {
struct z_heap *h = heap->heap; struct z_heap *h = heap->heap;
CHECK((align & (align - 1)) == 0); __ASSERT((align & (align - 1)) == 0, "align must be a power of 2");
if (align <= chunk_header_bytes(h)) { if (align <= chunk_header_bytes(h)) {
return sys_heap_alloc(heap, bytes); return sys_heap_alloc(heap, bytes);