Commit 00e5503
Jeremy Fitzhardinge
Add const-generic bitfield accessors for compile-time optimization
Add a specialized impl block for `__BindgenBitfieldUnit<[u8; N]>` with
const-generic methods: `get_const`, `set_const`, `raw_get_const`, and
`raw_set_const`. These methods take bit offset and width as const generic
parameters, allowing the compiler to fully optimize bitfield access at
compile time.
Update codegen to use the new const-generic methods for generated
bitfield accessors. Since all bitfield offsets and widths are known at
code generation time, this enables better optimization.
The original runtime-parameter methods are preserved for backwards
compatibility with users who provide custom implementations via the
blocklist mechanism.1 parent c993830 commit 00e5503
File tree
45 files changed
+16722
-4266
lines changed- bindgen-tests/tests/expectations/tests
- bindgen/codegen
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
45 files changed
+16722
-4266
lines changedLines changed: 967 additions & 584 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 337 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 316 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 297 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments