You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first example in section "Owners, consumers, and lifetime management" does not match to the text. E.g. Span<T>.Clear is never used in the example but mentioned in the text.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 4819512e-1044-1c57-0de1-447164220fd5
Version Independent ID: d6cf8d26-fb2f-7138-f0c7-ab529a5b9cde
Other text doesn't match the example, e.g. it says it has a Memory<char> but the sample uses a conceptual type called Buffer. I think it's intentional that the sample is using concepts instead of concrete types, so perhaps it's the prose that needs to be equally generalized.
This example/text mismatch was reported earlier by #15934. This issue is a duplicate but since the other was just closed by our stale issue bot, I'll leave that one closed and this one open.
Let's stick a pin in Memory<T> for now and speak about buffers in more general terms.
And aside from that one fragment, the rest of the section text doesn't mention Span<T> or Memory<T>at all.
If we wanted to keep this section generalized as in the original draft, we should remove references to things like Span<T>.Clear, which aren't relevant to the sample code. Or, if we wanted to make this section specific to Span<T> or Memory<T>, we need to reconsider the sample. You can't "rent" spans (since they're abstractions). And I think this part of the article might be too early to introduce dangerous concepts like ArrayPool<T>.
Activity
tdykstra commentedon Jan 7, 2021
@bartonjs Should
buffer.Destroy()in the pseudo-code example be changed tobuffer.Clear()?bartonjs commentedon Jan 7, 2021
Other text doesn't match the example, e.g. it says it has a
Memory<char>but the sample uses a conceptual type calledBuffer. I think it's intentional that the sample is using concepts instead of concrete types, so perhaps it's the prose that needs to be equally generalized.@GrabYourPitchforks was this you?
tdykstra commentedon Jan 25, 2021
This example/text mismatch was reported earlier by #15934. This issue is a duplicate but since the other was just closed by our stale issue bot, I'll leave that one closed and this one open.
tdykstra commentedon Feb 5, 2021
ping @GrabYourPitchforks
GrabYourPitchforks commentedon Feb 5, 2021
The example was largely copied from https://gist.github.com/GrabYourPitchforks/4c3e1935fd4d9fa2831dbfcab35dffc6, but that was meant to describe more general concepts and wasn't really talking about
Span<T>orMemory<T>as a technology. In fact, the original draft includes this text directly above the buffer sample:And aside from that one fragment, the rest of the section text doesn't mention
Span<T>orMemory<T>at all.If we wanted to keep this section generalized as in the original draft, we should remove references to things like
Span<T>.Clear, which aren't relevant to the sample code. Or, if we wanted to make this section specific toSpan<T>orMemory<T>, we need to reconsider the sample. You can't "rent" spans (since they're abstractions). And I think this part of the article might be too early to introduce dangerous concepts likeArrayPool<T>.