From 74986c1dd141f1b255b82ae9e7950fe0614f1f95 Mon Sep 17 00:00:00 2001 From: daan Date: Tue, 19 May 2020 09:56:37 -0700 Subject: [PATCH] weaken aligmenment assertion (issue #245) --- src/alloc-aligned.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alloc-aligned.c b/src/alloc-aligned.c index 15ebd59d..ca16d367 100644 --- a/src/alloc-aligned.c +++ b/src/alloc-aligned.c @@ -53,7 +53,7 @@ static void* mi_heap_malloc_zero_aligned_at(mi_heap_t* const heap, const size_t // .. and align within the allocation uintptr_t adjust = alignment - (((uintptr_t)p + offset) & align_mask); - mi_assert_internal(adjust % sizeof(uintptr_t) == 0); + mi_assert_internal(adjust <= alignment); void* aligned_p = (adjust == alignment ? p : (void*)((uintptr_t)p + adjust)); if (aligned_p != p) mi_page_set_has_aligned(_mi_ptr_page(p), true); mi_assert_internal(((uintptr_t)aligned_p + offset) % alignment == 0);