improve layout of page for x64

This commit is contained in:
daan 2019-08-11 10:31:00 -07:00
parent 2c1da9d194
commit 7b105c4810
4 changed files with 17 additions and 17 deletions

View file

@ -91,7 +91,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU")
if(CMAKE_C_COMPILER_ID MATCHES "GNU") if(CMAKE_C_COMPILER_ID MATCHES "GNU")
list(APPEND mi_cflags -Wno-invalid-memory-model) list(APPEND mi_cflags -Wno-invalid-memory-model)
list(APPEND mi_cflags -fvisibility=hidden) list(APPEND mi_cflags -fvisibility=hidden)
list(APPEND mi_cflags -fbranch-target-load-optimize ) list(APPEND mi_cflags -fbranch-target-load-optimize)
endif() endif()
endif() endif()

View file

@ -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

View file

@ -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;

View file

@ -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
}; };