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
According to rust-lang/rust#67186 LLVM only permits generating arrays (or perhaps indexing into them) of isize::MAX as opposed to the theoretical maximum of usize::MAX imposed by the size of a pointer. (Apparently the reason for the restriction is related to doing pointer arithmetic potentially involving negative numbers, which a language like C would permit in userspace.)
Is this still true? Inkwell's API doesn't suggest or mention it, so it seems worth verifying empirically. What about for Cranelift? (If it's not true, it seems better to go with usize::MAX since Roc doesn't support arbitrary pointer arithmetic.) Probably the easiest way to verify it is through a List.range test.
If it is true, how should we enforce this? Error if attempting to create a list that's over isize::MAX elements?
The text was updated successfully, but these errors were encountered:
rtfeldman
changed the title
Test whether llvm allows usize::MAX array lengths
Test whether llvm and Cranelift allow usize::MAX array lengths
Mar 15, 2020
According to rust-lang/rust#67186 LLVM only permits generating arrays (or perhaps indexing into them) of
isize::MAX
as opposed to the theoretical maximum ofusize::MAX
imposed by the size of a pointer. (Apparently the reason for the restriction is related to doing pointer arithmetic potentially involving negative numbers, which a language like C would permit in userspace.)Is this still true? Inkwell's API doesn't suggest or mention it, so it seems worth verifying empirically. What about for Cranelift? (If it's not true, it seems better to go with
usize::MAX
since Roc doesn't support arbitrary pointer arithmetic.) Probably the easiest way to verify it is through aList.range
test.If it is true, how should we enforce this? Error if attempting to create a list that's over
isize::MAX
elements?The text was updated successfully, but these errors were encountered: