diff --git a/furi/core/memmgr_heap.c b/furi/core/memmgr_heap.c index 5afeb8f67..4edb9c5bd 100644 --- a/furi/core/memmgr_heap.c +++ b/furi/core/memmgr_heap.c @@ -246,6 +246,11 @@ extern void* pvPortAllocAligned(size_t xSize, size_t xAlignment) { furi_crash("memmgt in ISR"); } + // alignment must be power of 2 + if((xAlignment & (xAlignment - 1)) != 0) { + furi_crash("invalid alignment"); + } + memmgr_lock(); // allocate block