Skip to content
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

Confusing sentence in documentation of System.Runtime.CompilerServices.Unsafe.ReadUnaligned #5342

Open
RamType0 opened this issue Oct 30, 2020 · 3 comments · May be fixed by #5063
Open

Confusing sentence in documentation of System.Runtime.CompilerServices.Unsafe.ReadUnaligned #5342

RamType0 opened this issue Oct 30, 2020 · 3 comments · May be fixed by #5063
Labels
area-System.Runtime.CompilerServices Pri3 Indicates issues/PRs that are low priority untriaged New issue has not been triaged by the area owner

Comments

@RamType0
Copy link

The documentation says that

Reads a value of type T from the given location without assuming architecture dependent alignment of the addresses.

What means "without assuming architecture dependent alignment of the addresses" ?
This sentence is really confusing.
When the first time I see this documentation, I thought that
"If we forget to assuming architecture dependent alignment of the addresses while read or write from unaligned addresses, we will fail it. So, this method requires alignment."
IMHO,
"Reads a value of type T correctly from given location even if while we use the platform which requires alignment and given location is unaligned."
is better sentence.

Unsafe.WriteUnaligned also has same problem.

@SingleAccretion
Copy link
Contributor

Reads a value of type T correctly from given location even if while we use the platform which requires alignment and given location is unaligned

Reads a value of type T correctly from the given location even if the current platform requires alignment and the given location is not properly aligned?

This would be PR for consideration to dotnet/dotnet-api-docs, presumably. I personally think it would be an improvement (the current doc is probably meant to convey that this API explicitly invalidates IL's assumption that addresses are aligned).

RamType0 referenced this issue in RamType0/dotnet-api-docs Oct 30, 2020
…ment of the addresses" (Fix dotnet/runtime#44063)
@buyaa-n
Copy link
Contributor

buyaa-n commented Feb 16, 2021

This would be PR for consideration to dotnet/dotnet-api-docs, presumably.

That is right, transferring the issue to dotnet/dotnet-api-docs

@buyaa-n buyaa-n transferred this issue from dotnet/runtime Feb 16, 2021
@PRMerger6 PRMerger6 added the Pri3 Indicates issues/PRs that are low priority label Feb 16, 2021
@dotnet-bot dotnet-bot added the untriaged New issue has not been triaged by the area owner label Feb 16, 2021
@dotnet-issue-labeler
Copy link

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.

RamType0 added a commit to RamType0/dotnet-api-docs that referenced this issue Mar 27, 2021
RamType0 added a commit to RamType0/dotnet-api-docs that referenced this issue Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Runtime.CompilerServices Pri3 Indicates issues/PRs that are low priority untriaged New issue has not been triaged by the area owner
Projects
None yet
5 participants