mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
merge from dev
This commit is contained in:
commit
3726cf94ba
106 changed files with 6623 additions and 5540 deletions
|
@ -40,6 +40,7 @@ extern inline void* _mi_page_malloc_zero(mi_heap_t* heap, mi_page_t* page, size_
|
|||
page->free = mi_block_next(page, block);
|
||||
page->used++;
|
||||
mi_assert_internal(page->free == NULL || _mi_ptr_page(page->free) == page);
|
||||
mi_assert_internal(_mi_is_aligned(block, MI_MAX_ALIGN_SIZE));
|
||||
#if MI_DEBUG>3
|
||||
if (page->free_is_zero) {
|
||||
mi_assert_expensive(mi_mem_is_zero(block+1,size - sizeof(*block)));
|
||||
|
@ -530,7 +531,7 @@ mi_decl_nodiscard mi_decl_restrict void* mi_heap_alloc_new_n(mi_heap_t* heap, si
|
|||
}
|
||||
|
||||
mi_decl_nodiscard mi_decl_restrict void* mi_new_n(size_t count, size_t size) {
|
||||
return mi_heap_alloc_new_n(mi_prim_get_default_heap(), size, count);
|
||||
return mi_heap_alloc_new_n(mi_prim_get_default_heap(), count, size);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -542,6 +542,7 @@ void _mi_heap_area_init(mi_heap_area_t* area, mi_page_t* page) {
|
|||
area->used = page->used; // number of blocks in use (#553)
|
||||
area->block_size = ubsize;
|
||||
area->full_block_size = bsize;
|
||||
area->heap_tag = page->heap_tag;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -360,6 +360,8 @@ static size_t mi_segment_calculate_slices(size_t required, size_t* info_slices)
|
|||
required = _mi_align_up(required, MI_SEGMENT_SLICE_SIZE) + page_size;
|
||||
}
|
||||
}
|
||||
mi_assert_internal(_mi_is_aligned(p, MI_MAX_ALIGN_SIZE));
|
||||
mi_assert_internal(block_size > MI_MAX_ALIGN_GUARANTEE || _mi_is_aligned(p,block_size));
|
||||
|
||||
isize = _mi_align_up(isize + guardsize, MI_SEGMENT_SLICE_SIZE);
|
||||
if (info_slices != NULL) *info_slices = isize / MI_SEGMENT_SLICE_SIZE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue