Skip to content

Commit 9b02a2d

Browse files
committed
Auto merge of #45514 - gnzlbg:jemalloc_realloc2, r=<try>
[jemalloc] set correct excess in realloc_excess
2 parents 56dc171 + 45ef012 commit 9b02a2d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/liballoc_jemalloc/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,10 @@ mod contents {
219219
err: *mut u8) -> *mut u8 {
220220
let p = __rde_realloc(ptr, old_size, old_align, new_size, new_align, err);
221221
if !p.is_null() {
222-
*excess = new_size;
222+
let flags = align_to_flags(new_align);
223+
*excess = nallocx(new_size, flags) as usize;
223224
}
224-
return p
225+
p
225226
}
226227

227228
#[no_mangle]

0 commit comments

Comments
 (0)