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.)
This commit is contained in:
Felix S. Klock II 2013-11-22 18:00:21 +01:00
parent 747213a280
commit 861e6f5cd2
1 changed files with 0 additions and 1 deletions

View File

@ -20,7 +20,6 @@ extern {
#[inline]
pub fn get_box_size(body_size: uint, body_align: uint) -> uint {
let header_size = size_of::<raw::Box<()>>();
// FIXME (#2699): This alignment calculation is suspicious. Is it right?
let total_size = align_to(header_size, body_align) + body_size;
total_size
}