Closed TimDiekmann closed 4 years ago
The guard exists for a good reason: LLVM generates buggy code when indexing an array with more than isize::MAX
elements, or generally any object with a size larger than isize::MAX
bytes.
I don't think that moving this logic into the AllocRef
trait is the right thing to do: the guard needs to exist regardless of what the allocator back-end is, it is not something that an allocator would want to customize.
Ah, wasn't aware of the LLVM bug, thanks!
Every allocation in
RawVec
is guarded to a maximum allocation size ofisize::MAX
:Shouldn't this guard be moved into the implementations of
AllocRef
instead? The guard was added beforeAlloc
was added: raw_vec.rs @ Rust 1.3.0