mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 06:59:32 +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
|
@ -91,7 +91,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU")
|
|||
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||
list(APPEND mi_cflags -Wno-invalid-memory-model)
|
||||
list(APPEND mi_cflags -fvisibility=hidden)
|
||||
list(APPEND mi_cflags -fbranch-target-load-optimize )
|
||||
list(APPEND mi_cflags -fbranch-target-load-optimize)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ typedef struct mi_page_s {
|
|||
|
||||
// improve page index calculation
|
||||
#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
|
||||
// void* padding[1]; // 12 words on 32-bit
|
||||
#endif
|
||||
|
|
|
@ -225,7 +225,7 @@ void mi_free(void* p) mi_attr_noexcept
|
|||
}
|
||||
#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)
|
||||
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`
|
||||
#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
|
||||
// local, and not full or aligned
|
||||
mi_block_t* block = (mi_block_t*)p;
|
||||
|
|
|
@ -21,7 +21,7 @@ const mi_page_t _mi_page_empty = {
|
|||
NULL, 0, 0,
|
||||
0, NULL, NULL, NULL
|
||||
#if (MI_INTPTR_SIZE==8 && MI_SECURE==0)
|
||||
, { NULL }
|
||||
// , { NULL }
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue