Skip to content
This repository was archived by the owner on Aug 2, 2023. It is now read-only.

Alignment and 2 GiB overflow issues in Span<T>.TryCopyTo #848

Closed
mgravell opened this issue Sep 28, 2016 · 1 comment · Fixed by dotnet/corefx#12443
Closed

Alignment and 2 GiB overflow issues in Span<T>.TryCopyTo #848

mgravell opened this issue Sep 28, 2016 · 1 comment · Fixed by dotnet/corefx#12443

Comments

@mgravell
Copy link
Member

mgravell commented Sep 28, 2016

Only affects the IsPrimitiveValueType<T> case;

  • overflow for large src.Length and non-trivial T; might need to loop, since cpblk is limited to uint sizes (thus is not quite the same issue as Extensive 2 GiB overflow problems in Span<T> #846)
  • CopyBlock assumes that the pointers are aligned; otherwise, cpblk needs the unaligned prefix

(also impacts ReadOnlySpan<T>)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants