-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer.Memmove
has unaligned casts
#83709
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/area-system-runtime Issue Details
|
For such integer reads/writes we assume that OS will be able to fix them for us via alignment fixups. On OSes without such fixups we have plenty of potential problems as is, Unsafe.Read/WriteUnaligned won't help (the way they're implemented now in JIT). See #80068 (comment) |
We likely should be using |
@tannergooding We would regress when using internal static void CopyBlock64(ref byte dest, ref byte src)
{
Unsafe.As<byte, Block64>(ref dest) = Unsafe.As<byte, Block64>(ref src);
}
internal static void CopyBlock64Unaligned(ref byte dest, ref byte src)
{
Unsafe.WriteUnaligned<Block64>(ref dest, Unsafe.ReadUnaligned<Block64>(ref src));
}
internal static void CopyBlockUnaligned(ref byte dest, ref byte src)
{
Unsafe.CopyBlockUnaligned(ref dest, ref src, 64);
} |
|
Fix dotnet#83709 IL size is reduced by ~140 bytes.
Fix dotnet#83709 IL size is reduced by ~140 bytes.
Fix dotnet#83709 IL size is reduced by ~140 bytes.
Fix dotnet#83709 IL size is reduced by ~140 bytes.
Fix dotnet#83709 IL size is reduced by ~140 bytes.
Fix dotnet#83709 IL size is reduced by ~140 bytes.
#26654 (comment):
cc:@GrabYourPitchforks
The text was updated successfully, but these errors were encountered: