Skip to content

Commit 3cbc7a3

Browse files
committed
Align size of allocation to provider's page size in arena_extent_alloc()
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 27edb79 commit 3cbc7a3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/pool/pool_jemalloc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ static void *arena_extent_alloc(extent_hooks_t *extent_hooks, void *new_addr,
7676

7777
jemalloc_memory_pool_t *pool = get_pool_by_arena_index(arena_ind);
7878

79+
// align a size of the allocation to the provider's page size
80+
size = ALIGN_UP(size, pool->page_size);
81+
7982
void *ptr = new_addr;
8083
ret = umfMemoryProviderAlloc(pool->provider, size, alignment, &ptr);
8184
if (ret != UMF_RESULT_SUCCESS) {

0 commit comments

Comments
 (0)