We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0560fc2 commit 09c658dCopy full SHA for 09c658d
src/os.c
@@ -585,7 +585,7 @@ static mi_decl_cache_align _Atomic(uintptr_t) aligned_base;
585
static void* mi_os_get_aligned_hint(size_t try_alignment, size_t size)
586
{
587
if (try_alignment == 0 || try_alignment > MI_SEGMENT_SIZE) return NULL;
588
- if ((size%MI_SEGMENT_SIZE) != 0) return NULL;
+ size = _mi_align_up(size, MI_SEGMENT_SIZE);
589
if (size > 1*MI_GiB) return NULL; // guarantee the chance of fixed valid address is at most 1/(KK_HINT_AREA / 1<<30) = 1/4096.
590
#if (MI_SECURE>0)
591
size += MI_SEGMENT_SIZE; // put in `MI_SEGMENT_SIZE` virtual gaps between hinted blocks; this splits VLA's but increases guarded areas.
0 commit comments