Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make the memory handlers readonly structs.
  • Loading branch information
teo-tsirpanis authored and github-actions committed Aug 31, 2021
commit 8621c024ec2d1df2b5aa9854b12c9504e2d9e886
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,13 @@ private interface IMemoryHandler<T>
MemoryHandle Pin(in T memory);
}

private struct MemoryHandler : IMemoryHandler<Memory<byte>>
private readonly struct MemoryHandler : IMemoryHandler<Memory<byte>>
{
public int GetLength(in Memory<byte> memory) => memory.Length;
public MemoryHandle Pin(in Memory<byte> memory) => memory.Pin();
}

private struct ReadOnlyMemoryHandler : IMemoryHandler<ReadOnlyMemory<byte>>
private readonly struct ReadOnlyMemoryHandler : IMemoryHandler<ReadOnlyMemory<byte>>
{
public int GetLength(in ReadOnlyMemory<byte> memory) => memory.Length;
public MemoryHandle Pin(in ReadOnlyMemory<byte> memory) => memory.Pin();
Expand Down