Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update book section about inlined functions #2454

Merged
merged 2 commits into from
Mar 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
flip order
  • Loading branch information
pvdrz committed Mar 21, 2023
commit 10c89c915ddae20355154b7472aad4f0c3a18a86
8 changes: 4 additions & 4 deletions book/src/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ shared library, for example), then you can pass `-fkeep-inline-functions` or
the `bindgen::Builder::generate_inline_functions` method or the
`--generate-inline-functions` flag.

Note that these functions and methods are usually marked inline for a reason:
they tend to be hot. The above workaround makes them an out-of-line call, which
might not provide acceptable performance.

As an alternative, you can invoke `bindgen` with either the
`bindgen::Builder::wrap_static_fns` method or the `--wrap-static-fns` flag.
Which generates a C source file that can be compiled against the input headers
to produce Rust headers for `static` and `static inline` functions. See [How to
handle `static inline` functions](https://github.com/rust-lang/rust-bindgen/discussions/2405)
for further information.

Note that these functions and methods are usually marked inline for a reason:
they tend to be hot. The above workaround makes them an out-of-line call, which
might not provide acceptable performance.

### Does `bindgen` support the C++ Standard Template Library (STL)?

Sort of. A little. Depends what you mean by "support".
Expand Down