You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adopt and document a preference for aligned loads in validation (#2985)
This commit parameterizes `TryFromBytes::is_bit_valid` and
`Ptr::read` over alignment, ensuring that well-aligned loads are
used at the leaves of validation whenever possible. This carries
a performance advantage over unaligned loads on many platforms.
This manifests in our API as an optimization for `try_transmute!`
and `TryFromBytes::try_read_from_*` for destination types with
alignments greater than 1. For trivially-aligned destination types,
this commit introduces an optimization FIXME noting that validation
could (and should) be performed in-place.
Makes progress towards #2981.
gherrit-pr-id: G74407a530f46f997b4faaeac52452ebc9892b2ae
0 commit comments