diff options
| author | Jason Evans <jasone@canonware.com> | 2016-06-08 18:41:24 (GMT) |
|---|---|---|
| committer | Jason Evans <jasone@canonware.com> | 2016-06-08 18:41:24 (GMT) |
| commit | 3de035335255d553bdb344c32ffdb603816195d8 (patch) | |
| tree | 24896f5754301439fbfd4c280c71e46e5c830207 /include/jemalloc | |
| parent | f70a254d44c8d30af2cd5d30531fb18fdabaae6d (diff) | |
| parent | 5271b673b2e93dd655fde6f2ee1ea849da5cb3d2 (diff) | |
| download | jemalloc-4.2.1.zip jemalloc-4.2.1.tar.gz jemalloc-4.2.1.tar.bz2 | |
Merge branch.4.2.1
Diffstat (limited to 'include/jemalloc')
| -rw-r--r-- | include/jemalloc/internal/jemalloc_internal.h.in | 4 | ||||
| -rw-r--r-- | include/jemalloc/internal/prof.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in index 51bf897..8f82edd 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -754,7 +754,7 @@ sa2u(size_t size, size_t alignment) * Calculate the size of the over-size run that arena_palloc() * would need to allocate in order to guarantee the alignment. */ - if (usize + large_pad + alignment <= arena_maxrun) + if (usize + large_pad + alignment - PAGE <= arena_maxrun) return (usize); } @@ -784,7 +784,7 @@ sa2u(size_t size, size_t alignment) * Calculate the multi-chunk mapping that huge_palloc() would need in * order to guarantee the alignment. */ - if (usize + alignment < usize) { + if (usize + alignment - PAGE < usize) { /* size_t overflow. */ return (0); } diff --git a/include/jemalloc/internal/prof.h b/include/jemalloc/internal/prof.h index 691e153..21dff5f 100644 --- a/include/jemalloc/internal/prof.h +++ b/include/jemalloc/internal/prof.h @@ -513,6 +513,7 @@ prof_realloc(tsd_t *tsd, const void *ptr, size_t usize, prof_tctx_t *tctx, * though its actual usize was insufficient to cross the * sample threshold. */ + prof_alloc_rollback(tsd, tctx, true); tctx = (prof_tctx_t *)(uintptr_t)1U; } } |
