Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Combining the T[] and OwnedBuffer<T> fields of Buffer<T> into a single object #1634

Merged
merged 11 commits into from
Jun 28, 2017
Prev Previous commit
Next Next commit
Removing unnecessary unsafe keyword since buffer no longer contains v…
…oid*
  • Loading branch information
ahsonkhan committed Jun 27, 2017
commit 26b8bc6b1095da17c953774218e5d4c418327fb3
2 changes: 1 addition & 1 deletion src/System.Buffers.Primitives/System/Buffers/Buffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace System
{
[DebuggerTypeProxy(typeof(BufferDebuggerView<>))]
public unsafe struct Buffer<T>
public struct Buffer<T>
{
readonly object _arrayOrOwnedBuffer;
Copy link
Member

Choose a reason for hiding this comment

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

It would be good to add a comment that explains how this works, i.e. that _index high order bit is used to identify the modes.

readonly int _index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace System
{
[DebuggerTypeProxy(typeof(ReadOnlyBufferDebuggerView<>))]
public unsafe struct ReadOnlyBuffer<T>
public struct ReadOnlyBuffer<T>
{
readonly object _arrayOrOwnedBuffer;
readonly int _index;
Expand Down