This method is not safe?

Open Beginner friendly
#12,558 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
csharp
Domain
documentation

Research direction

Start with xml/System.IO/UnmanagedMemoryAccessor.xml and compare the ReadArray documentation with the linked API page. Review the wording around safety, the starting position or offset, and the return value at the end of the accessor; done means the documentation is corrected and the behavior is clear.

Written by the indexing model from the issue text.

Description

area-System.IO untriaged
Type of issue

Typo

Description

It says "This method is not safe." Yikes, what does that mean exactly? I assume it's a typo -- I assume it means to say "not thread-safe" -- but that's also a weird thing to say about a method that's copying memory.. obviously no mem-copy operation is thread-safe, if there are other threads modifying that memory.

There are other errors here.. it says if "array is not large enough to contain count of structures (starting from position)". I believe it means to say "starting from offset".

I came here, looking for clarification on the return value when hitting the end of the accessor .. but that's pretty unclear, I'll just have to test it.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.io.unmanagedmemoryaccessor.readarray?view=netframework-4.8&devlangs=csharp&f1url=%3FappId%3DDev17IDEF1%26l%3DEN-US%26k%3Dk(System.IO.UnmanagedMemoryAccessor.ReadArray%60%601);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.8);k(DevLang-csharp)%26rd%3Dtrue

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.IO/UnmanagedMemoryAccessor.xml

Document Version Independent Id

74f2103a-0012-151b-4019-b12421cf56a3

Platform Id

09137589-dc72-efa3-27df-5494fa3caf68

Article author

@dotnet-bot

Dominant language
C#
Stars
950
Forks
1.7k
Avg merge
3d 5h
Merged PRs (30d)
38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/dotnet-api-docs

All issues in dotnet/dotnet-api-docs

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.