From 15dff150d05481cc2ecf76a1660b1da74fb4ff6f Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Wed, 25 Oct 2017 09:19:40 +0200 Subject: [PATCH] [jemalloc] set correct excess in alloc_excess --- src/liballoc_jemalloc/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/liballoc_jemalloc/lib.rs b/src/liballoc_jemalloc/lib.rs index d153f19c4622f..4fac78eabb036 100644 --- a/src/liballoc_jemalloc/lib.rs +++ b/src/liballoc_jemalloc/lib.rs @@ -203,7 +203,8 @@ mod contents { err: *mut u8) -> *mut u8 { let p = __rde_alloc(size, align, err); if !p.is_null() { - *excess = size; + let flags = align_to_flags(align); + *excess = nallocx(size, flags) as usize; } return p }