diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-06-30 22:41:51 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-06-30 22:41:51 -0400 |
| commit | 0d7799d3048eea4039d59c0cca98449e1c52a561 (patch) | |
| tree | 711239216a9dfb22d2ba90990b49b71c5ce566c4 /src/libstd | |
| parent | b731d96b4f2a8d5733e79a863c40632425456520 (diff) | |
| download | rust-0d7799d3048eea4039d59c0cca98449e1c52a561.tar.gz rust-0d7799d3048eea4039d59c0cca98449e1c52a561.zip | |
global_heap: inline get_box_size and align_to
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/rt/global_heap.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/global_heap.rs index a7fbed2dd70..1e0ad3352fe 100644 --- a/src/libstd/rt/global_heap.rs +++ b/src/libstd/rt/global_heap.rs @@ -18,6 +18,7 @@ extern { fn abort(); } +#[inline] fn get_box_size(body_size: uint, body_align: uint) -> uint { let header_size = size_of::<BoxHeaderRepr>(); // 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 { // Rounds |size| to the nearest |alignment|. Invariant: |alignment| is a power // of two. +#[inline] fn align_to(size: uint, align: uint) -> uint { assert!(align != 0); (size + align - 1) & !(align - 1) |
