Skip to content

Commit

Permalink
Auto merge of rust-lang#45514 - gnzlbg:jemalloc_realloc2, r=sfackler
Browse files Browse the repository at this point in the history
[jemalloc] set correct excess in realloc_excess
  • Loading branch information
bors committed Nov 4, 2017
2 parents 95a4016 + 549ab77 commit a454152
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/liballoc_jemalloc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -219,9 +220,10 @@ mod contents {
err: *mut u8) -> *mut u8 {
let p = __rde_realloc(ptr, old_size, old_align, new_size, new_align, err);
if !p.is_null() {
*excess = new_size;
let flags = align_to_flags(new_align);
*excess = nallocx(new_size, flags) as usize;
}
return p
p
}

#[no_mangle]
Expand Down

0 comments on commit a454152

Please sign in to comment.