Skip to content

Commit 861e6f5

Browse files
committed
The original fixme #2699 was removed back in PR #6053.
I cannot tell whether the original comment was unsure about the arithmetic calculations, or if it was unsure about the assumptions being made about the alignment of the current allocation pointer. The arithmetic calculation looks fine to me, though. This technique is documented e.g. in Henry Warren's "Hacker's Delight" (section 3-1). (I am sure one can find it elsewhere too, its not an obscure property.)
1 parent 747213a commit 861e6f5

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/libstd/rt/global_heap.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ extern {
2020
#[inline]
2121
pub fn get_box_size(body_size: uint, body_align: uint) -> uint {
2222
let header_size = size_of::<raw::Box<()>>();
23-
// FIXME (#2699): This alignment calculation is suspicious. Is it right?
2423
let total_size = align_to(header_size, body_align) + body_size;
2524
total_size
2625
}

0 commit comments

Comments
 (0)