mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 15:09:31 +03:00
use heap_stat_increase macros when possible
This commit is contained in:
parent
72ab945e28
commit
5613ffb508
1 changed files with 6 additions and 6 deletions
12
src/page.c
12
src/page.c
|
@ -252,7 +252,7 @@ static mi_page_t* mi_page_fresh_alloc(mi_heap_t* heap, mi_page_queue_t* pq, size
|
||||||
// a fresh page was found, initialize it
|
// a fresh page was found, initialize it
|
||||||
mi_assert_internal(pq==NULL || _mi_page_segment(page)->page_kind != MI_PAGE_HUGE);
|
mi_assert_internal(pq==NULL || _mi_page_segment(page)->page_kind != MI_PAGE_HUGE);
|
||||||
mi_page_init(heap, page, block_size, heap->tld);
|
mi_page_init(heap, page, block_size, heap->tld);
|
||||||
_mi_stat_increase(&heap->tld->stats.pages, 1);
|
mi_heap_stat_increase(heap, pages, 1);
|
||||||
if (pq!=NULL) mi_page_queue_push(heap, pq, page); // huge pages use pq==NULL
|
if (pq!=NULL) mi_page_queue_push(heap, pq, page); // huge pages use pq==NULL
|
||||||
mi_assert_expensive(_mi_page_is_valid(page));
|
mi_assert_expensive(_mi_page_is_valid(page));
|
||||||
return page;
|
return page;
|
||||||
|
@ -688,7 +688,7 @@ static mi_page_t* mi_page_queue_find_free_ex(mi_heap_t* heap, mi_page_queue_t* p
|
||||||
page = next;
|
page = next;
|
||||||
} // for each page
|
} // for each page
|
||||||
|
|
||||||
mi_stat_counter_increase(heap->tld->stats.searches, count);
|
mi_heap_stat_counter_increase(heap, searches, count);
|
||||||
|
|
||||||
if (page == NULL) {
|
if (page == NULL) {
|
||||||
_mi_heap_collect_retired(heap, false); // perhaps make a page available
|
_mi_heap_collect_retired(heap, false); // perhaps make a page available
|
||||||
|
@ -780,12 +780,12 @@ static mi_page_t* mi_huge_page_alloc(mi_heap_t* heap, size_t size) {
|
||||||
mi_page_set_heap(page, NULL);
|
mi_page_set_heap(page, NULL);
|
||||||
|
|
||||||
if (bsize > MI_HUGE_OBJ_SIZE_MAX) {
|
if (bsize > MI_HUGE_OBJ_SIZE_MAX) {
|
||||||
_mi_stat_increase(&heap->tld->stats.giant, bsize);
|
mi_heap_stat_increase(heap, giant, bsize);
|
||||||
_mi_stat_counter_increase(&heap->tld->stats.giant_count, 1);
|
mi_heap_stat_counter_increase(heap, giant_count, 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_mi_stat_increase(&heap->tld->stats.huge, bsize);
|
mi_heap_stat_increase(heap, huge, bsize);
|
||||||
_mi_stat_counter_increase(&heap->tld->stats.huge_count, 1);
|
mi_heap_stat_counter_increase(heap, huge_count, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return page;
|
return page;
|
||||||
|
|
Loading…
Add table
Reference in a new issue