Skip to content

Commit 0d7799d

Browse files
committed
global_heap: inline get_box_size and align_to
1 parent b731d96 commit 0d7799d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libstd/rt/global_heap.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ extern {
1818
fn abort();
1919
}
2020

21+
#[inline]
2122
fn get_box_size(body_size: uint, body_align: uint) -> uint {
2223
let header_size = size_of::<BoxHeaderRepr>();
2324
// FIXME (#2699): This alignment calculation is suspicious. Is it right?
@@ -27,6 +28,7 @@ fn get_box_size(body_size: uint, body_align: uint) -> uint {
2728

2829
// Rounds |size| to the nearest |alignment|. Invariant: |alignment| is a power
2930
// of two.
31+
#[inline]
3032
fn align_to(size: uint, align: uint) -> uint {
3133
assert!(align != 0);
3234
(size + align - 1) & !(align - 1)

0 commit comments

Comments
 (0)