define MI_MAX_ALLOC_SIZE as PTRDIFF_MAX (related to #877)

This commit is contained in:
Daan 2024-04-19 09:53:21 -07:00
parent 06b510c42d
commit 5050b63038
2 changed files with 3 additions and 1 deletions

View file

@ -195,6 +195,8 @@ typedef int32_t mi_ssize_t;
// Alignments over MI_BLOCK_ALIGNMENT_MAX are allocated in dedicated huge page segments
#define MI_BLOCK_ALIGNMENT_MAX (MI_SEGMENT_SIZE >> 1)
// we never allocate more than PTRDIFF_MAX (see also <https://sourceware.org/ml/libc-announce/2019/msg00001.html>)
#define MI_MAX_ALLOC_SIZE PTRDIFF_MAX
// ------------------------------------------------------
// Mimalloc pages contain allocated blocks