dotnet / dotnet/dotnet-api-docs
Confusing sentence in documentation of System.Runtime.CompilerServices.Unsafe.ReadUnaligned
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
[The documentation](https://docs.microsoft.com/dotnet/api/system.runtime.compilerservices.unsafe.readunaligned?view=netcore-3.1) 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.
Contributor guide
Assessment
This issue has not been assessed yet.