Skip to content

Conversation

@ahsonkhan
Copy link
Contributor

See dotnet/corefx#35554 for changes to the source.

Please review if the formatting and style/tone is appropriate.

Also, how do we generally add multiple remarks?

cc @mairaw

See dotnet/corefx#35554 for changes to the source.

Please review if the formatting and style/tone is appropriate.

cc @mairaw
@BillWagner
Copy link
Member

closing and reopening to start a new build.

@BillWagner BillWagner closed this Feb 25, 2019
@BillWagner BillWagner reopened this Feb 25, 2019
<summary>Returns a <see cref="T:System.Memory`1" /> to write to that is at least the requested size (specified by <paramref name="sizeHint" />).</summary>
<returns>A <see cref="T:System.Memory`1" /> of at least the size <paramref name="sizeHint" />. If <paramref name="sizeHint" /> is 0, returns a non-empty buffer.</returns>
<remarks>There is no guarantee that successive calls will return the same buffer or the same-sized buffer.</remarks>
<remarks>This must never return an empty <see cref="T:System.Memory`1" /> but it can throw <see cref="System.OutOfMemoryException"/> if the requested buffer size is not available.</remarks>
Copy link

Choose a reason for hiding this comment

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

I don't think implementations should throw OutOfMemoryException neither I think we should prescribe exception type here at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So remove the whole exception clause all together OR at least mention that it can throw?

Option 1:

<remarks>This must never return an empty <see cref="T:System.Memory`1" />.</remarks>

Option 2:

<remarks>This must never return an empty <see cref="T:System.Memory`1" /> but it can throw if the requested buffer size is not available.</remarks>

@pakrym
Copy link

pakrym commented Feb 25, 2019

LGTM

@BillWagner
Copy link
Member

We need to fix the build errors before we merge this. @mairaw @rpetrusha do you have any idea what's wrong? I looked at the PR and nothing looked obvious to me.

<summary>Requests a span that is at least <paramref name="sizeHint" /> in size if possible.</summary>
<returns>A span of size <paramref name="sizeHint" />, if it's available; otherwise, a memory span with the maximum available memory. If <paramref name="sizeHint" /> is 0, returns currently available memory.</returns>
<remarks>To be added.</remarks>
<param name="sizeHint">The minimum length of the returned <see cref="T:System.Span`1" />. If 0, some, non-empty buffer is returned. </param>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is the problem @BillWagner. The description for the param should have been updated on line 107 instead of added here. Same for the returns and remarks that are also duplicated here.

Choose a reason for hiding this comment

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

Thanks, @mairaw. I'd looked over this file multiple times and completely missed the duplication each time!

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

Thanks to @mairaw for the sharp 👀 and finding the build error.

This is ready to :shipit:

@BillWagner BillWagner merged commit 05fc7de into dotnet:master Feb 26, 2019
@ahsonkhan ahsonkhan deleted the patch-1 branch February 26, 2019 21:56
ahsonkhan added a commit to ahsonkhan/dotnet-api-docs that referenced this pull request Feb 26, 2019
BillWagner pushed a commit that referenced this pull request Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants