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
I think behaviour depends on the platform. At least on mine when usize overflows it wraps. As len() is defined with the difference of those pointers if one wraps and the other not the difference will be large and wrong.
I think to solve that one would have to track length independently or do something smart with those pointers in case of warping.
The text was updated successfully, but these errors were encountered:
The behavior doesn't depend on the platform, we use non-wrapping integers so on overflow we panic in debug mode and technically UB in release mode. On 64 bit platforms, overflows are unlikely to ever happen but you're not wrong that since on 32 bit platforms usize becomes 32 bit, overflows are imaginable. @NULLx76 we could change to u64, or at a very low periodicity scale the pointers down to keep them in range over time.
I think behaviour depends on the platform. At least on mine when usize overflows it wraps. As len() is defined with the difference of those pointers if one wraps and the other not the difference will be large and wrong.
I think to solve that one would have to track length independently or do something smart with those pointers in case of warping.
The text was updated successfully, but these errors were encountered: