Skip to content

Commit

Permalink
data_offset_align: add inline attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Jun 20, 2019
1 parent 4b44ad9 commit 85978d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,7 @@ fn data_offset_sized<T>() -> isize {
data_offset_align(align_of::<T>())
}

#[inline]
fn data_offset_align(align: usize) -> isize {
let layout = Layout::new::<RcBox<()>>();
(layout.size() + layout.padding_needed_for(align)) as isize
Expand Down
1 change: 1 addition & 0 deletions src/liballoc/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2423,6 +2423,7 @@ fn data_offset_sized<T>() -> isize {
data_offset_align(align_of::<T>())
}

#[inline]
fn data_offset_align(align: usize) -> isize {
let layout = Layout::new::<ArcInner<()>>();
(layout.size() + layout.padding_needed_for(align)) as isize
Expand Down

0 comments on commit 85978d0

Please sign in to comment.