Skip to content

Commit

Permalink
Remove comment about a branch being optimized out, fix #45831
Browse files Browse the repository at this point in the history
Most often, this code is used through the `std::heap::Heap`
and `#[gloabal_allocator]` indirection, so this branch is not
optimized out anymore.
  • Loading branch information
SimonSapin committed Nov 20, 2017
1 parent 2dd268b commit 43e32b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/liballoc_jemalloc/lib.rs
Expand Up @@ -72,8 +72,7 @@ mod contents {
const MALLOCX_ZERO: c_int = 0x40;

// The minimum alignment guaranteed by the architecture. This value is used to
// add fast paths for low alignment values. In practice, the alignment is a
// constant at the call site and the branch will be optimized out.
// add fast paths for low alignment values.
#[cfg(all(any(target_arch = "arm",
target_arch = "mips",
target_arch = "powerpc")))]
Expand Down
3 changes: 1 addition & 2 deletions src/liballoc_system/lib.rs
Expand Up @@ -25,8 +25,7 @@
#![rustc_alloc_kind = "lib"]

// The minimum alignment guaranteed by the architecture. This value is used to
// add fast paths for low alignment values. In practice, the alignment is a
// constant at the call site and the branch will be optimized out.
// add fast paths for low alignment values.
#[cfg(all(any(target_arch = "x86",
target_arch = "arm",
target_arch = "mips",
Expand Down

0 comments on commit 43e32b5

Please sign in to comment.