Uh oh!
There was an error while loading. Please reload this page.
Allow Size to be any valid u64 - #50916
Conversation
RalfJung
commented
May 20, 2018
LLVM doesn't support allocations or types larger than half the address space (and I am not sure about exactly half the address space). Is there any risk of those coming up after this patch? |
oli-obk
commented
May 20, 2018
We do have tests for these kinds of types. Not sure how to do tests for allocations of such sizes xD |
There was a problem hiding this comment.
I considered that. But i think being explicit is better. I don't feel too strongly about that though, so if you want I'll change it
There was a problem hiding this comment.
I think zero is misleading, I initially assumed it'd be a null pointer.
There was a problem hiding this comment.
Also, random thought: maybe MemoryPointer should be AllocPointer or AbstractPointer?
There was a problem hiding this comment.
We could just name it Pointer and rename the current Pointer struct to PrimvalPointer
There was a problem hiding this comment.
That seems worse. Maybe this?
enumScalar{Undef,Bits(u128),Ptr(Pointer),}enumValue{Scalar(Scalar),ScalarPair(Scalar,Scalar),ByRef(Pointer,Align),}There was a problem hiding this comment.
What about the current struct Pointer(Primval) type? It's just a wrapper around a PrimVal, but helps us not confuse normal PrimVals with those whose type is a pointer type.
There was a problem hiding this comment.
The type doesn't really matter, the value does (unless there are pointer-specific methods on the wrapper?). And I prefer Scalar over Primval, but I also forgot the latter is really a thing.
eddyb
commented
May 20, 2018
cc @alexcrichton@nagisa@arielb1@rkruppe |
alexcrichton
commented
May 21, 2018
Hm I don't recall myself, but others might! |
eddyb
commented
May 21, 2018
@bors r+ |
bors
commented
May 21, 2018
📌 Commit 9f79a19 has been approved by |
bors
commented
May 23, 2018
Allow `Size` to be any valid `u64` cc rust-lang/miri#378 (comment) The alternative is to make mir::interpret's pointer offsets not be `Size` fixes#50917 r? @eddyb
bors
commented
May 23, 2018
☀️ Test successful - status-appveyor, status-travis |
cc rust-lang/miri#378 (comment)
The alternative is to make mir::interpret's pointer offsets not be
Sizefixes#50917
r? @eddyb