mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 17:17:19 +03:00
Fix potential VM map fragmentation regression.
Revert 245ae6036c (Support --with-lg-page
values larger than actual page size.), because it could cause VM map
fragmentation if the kernel grows mmap()ed memory downward.
This resolves #391.
This commit is contained in:
parent
48384dc2d8
commit
05a9e4ac65
3 changed files with 4 additions and 4 deletions
|
|
@ -2687,7 +2687,7 @@ arena_palloc_large(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment,
|
|||
return (NULL);
|
||||
|
||||
alignment = PAGE_CEILING(alignment);
|
||||
alloc_size = usize + large_pad + alignment;
|
||||
alloc_size = usize + large_pad + alignment - PAGE;
|
||||
|
||||
malloc_mutex_lock(tsdn, &arena->lock);
|
||||
run = arena_run_alloc_large(tsdn, arena, alloc_size, false);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ chunk_alloc_mmap_slow(size_t size, size_t alignment, bool *zero, bool *commit)
|
|||
void *ret;
|
||||
size_t alloc_size;
|
||||
|
||||
alloc_size = size + alignment;
|
||||
alloc_size = size + alignment - PAGE;
|
||||
/* Beware size_t wrap-around. */
|
||||
if (alloc_size < size)
|
||||
return (NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue