weaken assertion, #245

This commit is contained in:
daan 2020-05-18 18:51:06 -07:00
parent 53aa46890a
commit 82e29f47b3

View file

@ -54,7 +54,7 @@ static void* mi_heap_malloc_zero_aligned_at(mi_heap_t* const heap, const size_t
// .. and align within the allocation // .. and align within the allocation
uintptr_t adjust = alignment - (((uintptr_t)p + offset) & align_mask); 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)); 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); if (aligned_p != p) mi_page_set_has_aligned(_mi_ptr_page(p), true);
mi_assert_internal(((uintptr_t)aligned_p + offset) % alignment == 0); mi_assert_internal(((uintptr_t)aligned_p + offset) % alignment == 0);