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
Our pointers can only index up to isize::MAX into an array because they do signed pointer arithmetic.
This means a List, Str, Dict, or Set must never exceed isize::MAX bytes of capacity, and should panic if they are about to, as the alternative would be undefined behavior. Notes:
This is bytes, not elements.
We should do this "overflow" check on all operations that can increase capacity, e.g. append, prepend, concat, reserve, withCapacity, etc.
We should also give a compile-time error if a list literal or string literal would be too big.
The text was updated successfully, but these errors were encountered:
Our pointers can only index up to
isize::MAX
into an array because they do signed pointer arithmetic.This means a
List
,Str
,Dict
, orSet
must never exceedisize::MAX
bytes of capacity, and should panic if they are about to, as the alternative would be undefined behavior. Notes:append
,prepend
,concat
,reserve
,withCapacity
, etc.The text was updated successfully, but these errors were encountered: