mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
fix padding check for aligned allocation; improve perf for small aligned allocations
This commit is contained in:
parent
7ff3ec2bf7
commit
4531367de2
5 changed files with 53 additions and 47 deletions
|
@ -54,16 +54,19 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||
#define MI_ENCODE_FREELIST 1
|
||||
#endif
|
||||
|
||||
// Reserve extra padding at the end of each block; must be a multiple of `sizeof(intptr_t)`!
|
||||
// Reserve extra padding at the end of each block; must be a multiple of `2*sizeof(intptr_t)`!
|
||||
// If free lists are encoded, the padding is checked if it was modified on free.
|
||||
#if (!defined(MI_PADDING))
|
||||
#if (MI_SECURE>=3 || MI_DEBUG>=1)
|
||||
#define MI_PADDING MI_MAX_ALIGN_SIZE
|
||||
#if (!defined(MI_PADDING) && (MI_SECURE>=3 || MI_DEBUG>=1))
|
||||
#define MI_PADDING
|
||||
#endif
|
||||
|
||||
#if defined(MI_PADDING)
|
||||
#define MI_PADDING_SIZE (2*sizeof(intptr_t))
|
||||
#else
|
||||
#define MI_PADDING 0
|
||||
#endif
|
||||
#define MI_PADDING_SIZE 0
|
||||
#endif
|
||||
|
||||
|
||||
// ------------------------------------------------------
|
||||
// Platform specific values
|
||||
// ------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue