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
Currently the core object type is represented as a raw point *const u8. A value of nil is represented by a null pointer. If we changed this to a NonNull<u8>, it would enable types like Option<Object> to be only a single word. However we would have to change the value of nil to something else (most likely 1). Not sure if this would be worth it, because we use nil a lot more than we do Option<Object>, but if changing nil to 1 instead of 0 had no real effect then it could be worth while.
The text was updated successfully, but these errors were encountered:
This is a low-level optimisation that can be carried out at any point, the main issue is that the less raw pointers are exposed the better. In Rust even things like vecnever get allocated with a null value… so I strongly recommend avoiding raw pointers at all costs.
There is not really a way to avoid that since they can encode integers and are also tagged. But we could change from a raw pointer to a NonNull<T> if we wanted to allow niche optimizations. As you said though, that could be carried out at any point without impacting the rest of the code.
Currently the core object type is represented as a raw point
*const u8
. A value ofnil
is represented by a null pointer. If we changed this to aNonNull<u8>
, it would enable types likeOption<Object>
to be only a single word. However we would have to change the value ofnil
to something else (most likely 1). Not sure if this would be worth it, because we usenil
a lot more than we doOption<Object>
, but if changing nil to 1 instead of 0 had no real effect then it could be worth while.The text was updated successfully, but these errors were encountered: