summaryrefslogtreecommitdiff
path: root/src/alloc-aligned.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc-aligned.c')
-rw-r--r--src/alloc-aligned.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/alloc-aligned.c b/src/alloc-aligned.c
index 2c8d8f3..bc26e29 100644
--- a/src/alloc-aligned.c
+++ b/src/alloc-aligned.c
@@ -41,6 +41,11 @@ static mi_decl_noinline void* mi_heap_malloc_zero_aligned_at_fallback(mi_heap_t*
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(p == _mi_page_ptr_unalign(_mi_ptr_segment(aligned_p), _mi_ptr_page(aligned_p), aligned_p));
+
+ if (p != aligned_p) {
+ mi_track_free(p);
+ mi_track_malloc(aligned_p,size,zero);
+ }
return aligned_p;
}
@@ -82,6 +87,7 @@ static void* mi_heap_malloc_zero_aligned_at(mi_heap_t* const heap, const size_t
void* p = _mi_page_malloc(heap, page, padsize, zero); // TODO: inline _mi_page_malloc
mi_assert_internal(p != NULL);
mi_assert_internal(((uintptr_t)p + offset) % alignment == 0);
+ mi_track_malloc(p,size,zero);
return p;
}
}