| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2023-03-11 | Move `Option::as_slice` to an always-sound implementation | Scott McMurray | -5/+13 | |
| This approach depends on CSE to not have any branches or selects when the guessed offset is correct -- which it always will be right now -- but to also be *sound* (just less efficient) if the layout algorithms change such that the guess is incorrect. | ||||
| 2023-03-01 | Add `Option::as_slice`(`_mut`) | Andre Bogus | -0/+28 | |
| This adds the following functions: * `Option<T>::as_slice(&self) -> &[T]` * `Option<T>::as_slice_mut(&mut self) -> &[T]` The `as_slice` and `as_slice_mut` functions benefit from an optimization that makes them completely branch-free. Note that the optimization's soundness hinges on the fact that either the niche optimization makes the offset of the `Some(_)` contents zero or the mempory layout of `Option<T>` is equal to that of `Option<MaybeUninit<T>>`. | ||||
