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

Add documentation for SafeBuffer.ReadSpan/WriteSpan #54942

Merged
merged 3 commits into from
Jul 2, 2021

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Jun 30, 2021

Add missing doc for new SafeBuffer.ReadSpan and SafeBuffer.WriteSpan 6.0 APIs.
Also copied over the docs for SafeBuffer.ReadArray/WriteArray into code.

Contributes to #54880

cc @AaronRobinsonMSFT @jkoritzinsky

@Tornhoof
Copy link
Contributor

At the top of the file in Line 7 the type is referenced as SafePointer, maybe change this too?

@@ -219,6 +226,11 @@ public void ReadArray<T>(ulong byteOffset, T[] array, int index, int count)
ReadSpan(byteOffset, new Span<T>(array, index, count));
}

/// <summary>
/// Reads value types from memory starting at the offset, and writes them into a span.</summary>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should say something about it using the length of the span to determine how much to read.

@elinor-fung elinor-fung merged commit 96ef64d into dotnet:main Jul 2, 2021
@elinor-fung elinor-fung deleted the doc-SafeBuffer branch July 2, 2021 16:29
@ghost ghost locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants