Skip to content

Commit

Permalink
Merge pull request #321 from pacak/docs
Browse files Browse the repository at this point in the history
Update docs to mention rustc's autoinlining
  • Loading branch information
pacak authored Oct 10, 2024
2 parents 757d1c7 + 74c7a72 commit f0f67c9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- add release-lto profile for slightly smaller/faster version
thanks @zamazan4ik for the suggestion
- detect and render merged functions (#310)
- update docs (#320)

## [0.2.40] - 2024-10-01
- more consistend behavior when only one item is detected (#312)
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ generic parameters and if it is exported (in case of a library) and not inlined
binary, example, test, etc.). If your function takes a generic parameter - try making a monomorphic
wrapper around it and make it `pub` and `#[inline(never)]`.

Alternatively if your function is too small - `rustc` might decide to inline it automatically
with the same result. Marking it with `#[inline(never)]` fixes this problem.
See https://github.com/rust-lang/rust/pull/116505 for more details

# Include related functions?

So suppose you have a function `foo` that calls some other function - `bar`. With `--context N`
Expand Down
4 changes: 4 additions & 0 deletions README.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ generic parameters and if it is exported (in case of a library) and not inlined
binary, example, test, etc.). If your function takes a generic parameter - try making a monomorphic
wrapper around it and make it `pub` and `#[inline(never)]`.

Alternatively if your function is too small - `rustc` might decide to inline it automatically
with the same result. Marking it with `#[inline(never)]` fixes this problem.
See https://github.com/rust-lang/rust/pull/116505 for more details

# Include related functions?

So suppose you have a function `foo` that calls some other function - `bar`. With `--context N`
Expand Down

0 comments on commit f0f67c9

Please sign in to comment.