Fix extent_{before,last,past}() to return page-aligned results.

This commit is contained in:
Jason Evans 2016-09-23 12:17:42 -07:00
parent e3187ec6b6
commit 73868b60f2

View File

@ -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