mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 15:09:31 +03:00
improve layout of page for x64
This commit is contained in:
parent
2c1da9d194
commit
7b105c4810
4 changed files with 17 additions and 17 deletions
|
@ -182,7 +182,7 @@ typedef struct mi_page_s {
|
||||||
|
|
||||||
// improve page index calculation
|
// improve page index calculation
|
||||||
#if (MI_INTPTR_SIZE==8 && MI_SECURE==0)
|
#if (MI_INTPTR_SIZE==8 && MI_SECURE==0)
|
||||||
void* padding[1]; // 12 words on 64-bit
|
// void* padding[1]; // 12 words on 64-bit
|
||||||
#elif MI_INTPTR_SIZE==4
|
#elif MI_INTPTR_SIZE==4
|
||||||
// void* padding[1]; // 12 words on 32-bit
|
// void* padding[1]; // 12 words on 32-bit
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -225,7 +225,7 @@ void mi_free(void* p) mi_attr_noexcept
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mi_page_t* page = _mi_segment_page_of(segment, p);
|
mi_page_t* const page = _mi_segment_page_of(segment, p);
|
||||||
|
|
||||||
#if (MI_STAT>1)
|
#if (MI_STAT>1)
|
||||||
mi_heap_t* heap = mi_heap_get_default();
|
mi_heap_t* heap = mi_heap_get_default();
|
||||||
|
@ -236,7 +236,7 @@ void mi_free(void* p) mi_attr_noexcept
|
||||||
// huge page stat is accounted for in `_mi_page_retire`
|
// huge page stat is accounted for in `_mi_page_retire`
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uintptr_t tid = _mi_thread_id();
|
const uintptr_t tid = _mi_thread_id();
|
||||||
if (mi_likely(tid == page->flags)) { // if equal, the thread id matches and it is not a full page, nor has aligned blocks
|
if (mi_likely(tid == page->flags)) { // if equal, the thread id matches and it is not a full page, nor has aligned blocks
|
||||||
// local, and not full or aligned
|
// local, and not full or aligned
|
||||||
mi_block_t* block = (mi_block_t*)p;
|
mi_block_t* block = (mi_block_t*)p;
|
||||||
|
|
|
@ -21,7 +21,7 @@ const mi_page_t _mi_page_empty = {
|
||||||
NULL, 0, 0,
|
NULL, 0, 0,
|
||||||
0, NULL, NULL, NULL
|
0, NULL, NULL, NULL
|
||||||
#if (MI_INTPTR_SIZE==8 && MI_SECURE==0)
|
#if (MI_INTPTR_SIZE==8 && MI_SECURE==0)
|
||||||
, { NULL }
|
// , { NULL }
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue