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
To my understanding, currently, a reference type has only one niche that is the null value, but a reference type must be properly aligned, which means in theory we can also utilize those unaligned values as niches. The total possible niches of a type can be calculated as:
where MEMORY_SPACE_SIZE is the theoretical maximum size of the memory space in bytes.
Is it possible for Rust to enable this optimization?
Additionally, is it possible to add a new NonNullAligned<T> type that has the same niches as &T? We can use it to implement Box, Rc, Arc and Vec types, so they can also have the same niches.