From 73868b60f22d40404572d124aa7e08de1d70724f Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Fri, 23 Sep 2016 12:17:42 -0700 Subject: Fix extent_{before,last,past}() to return page-aligned results. --- include/jemalloc/internal/extent.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/jemalloc/internal/extent.h b/include/jemalloc/internal/extent.h index eeebdf0..528759b 100644 --- a/include/jemalloc/internal/extent.h +++ b/include/jemalloc/internal/extent.h @@ -227,22 +227,23 @@ JEMALLOC_INLINE void * extent_before_get(const extent_t *extent) { - return ((void *)((uintptr_t)extent->e_addr - PAGE)); + return ((void *)((uintptr_t)extent_base_get(extent) - PAGE)); } JEMALLOC_INLINE void * extent_last_get(const extent_t *extent) { - return ((void *)((uintptr_t)extent->e_addr + extent_size_get(extent) - - PAGE)); + return ((void *)((uintptr_t)extent_base_get(extent) + + extent_size_get(extent) - PAGE)); } JEMALLOC_INLINE void * extent_past_get(const extent_t *extent) { - return ((void *)((uintptr_t)extent->e_addr + extent_size_get(extent))); + return ((void *)((uintptr_t)extent_base_get(extent) + + extent_size_get(extent))); } JEMALLOC_INLINE bool -- cgit v0.12