From 88b141cf1fb1ff9ba3fd033ac9f5e6b7eae4d919 Mon Sep 17 00:00:00 2001 From: daan Date: Mon, 13 Jan 2020 20:48:37 -0800 Subject: [PATCH] ensure proper padding for the page structure --- include/mimalloc-types.h | 6 +++--- src/init.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mimalloc-types.h b/include/mimalloc-types.h index b0b4a44f..ec382b5e 100644 --- a/include/mimalloc-types.h +++ b/include/mimalloc-types.h @@ -211,9 +211,9 @@ typedef struct mi_page_s { struct mi_page_s* prev; // previous page owned by this thread with the same `block_size` // improve page index calculation - // without padding: 10 words on 64-bit, 11 on 32-bit. Secure adds two words - #if (MI_INTPTR_SIZE==4) - void* padding[1]; // 12/14 words on 32-bit plain + // without padding: 11 words on 64-bit, 14 on 32-bit. Secure adds two words + #if (MI_INTPTR_SIZE==8) + void* padding[1]; // 12/14 words on 64-bit #endif } mi_page_t; diff --git a/src/init.c b/src/init.c index 1409faaa..51c18d93 100644 --- a/src/init.c +++ b/src/init.c @@ -26,7 +26,7 @@ const mi_page_t _mi_page_empty = { NULL, ATOMIC_VAR_INIT(0), ATOMIC_VAR_INIT(0), 0, NULL, NULL, NULL - #if (MI_INTPTR_SIZE==4) + #if (MI_INTPTR_SIZE==8) , { NULL } // padding #endif };