From 861e6f5cd26b4a568d64d78ec85f3e67ab2eea7b Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Fri, 22 Nov 2013 18:00:21 +0100 Subject: [PATCH] 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.) --- src/libstd/rt/global_heap.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/global_heap.rs index c6e2724b0f202..08d111da35155 100644 --- a/src/libstd/rt/global_heap.rs +++ b/src/libstd/rt/global_heap.rs @@ -20,7 +20,6 @@ extern { #[inline] pub fn get_box_size(body_size: uint, body_align: uint) -> uint { let header_size = size_of::>(); - // FIXME (#2699): This alignment calculation is suspicious. Is it right? let total_size = align_to(header_size, body_align) + body_size; total_size }