Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
4 votes
1 answer
2k views

Copy/set a single byte in a Memory<byte>

I'm starting out with System.Buffers.MemoryPool<T> and System.Memory<T> in C#, looking to reduce allocations for byte arrays. I have a bunch of bytes and byte arrays that I need to copy ...
Cocowalla's user avatar
  • 14.1k
3 votes
0 answers
103 views

What does ReSharper think I'm trying to do with readonly?

While writing C#, I accidentally missed the = new List<T>() off a collection initialiser, meaning that I wrote this incorrect code: readonly List<int> x { 1,2,3 } However, besides ...
Aaron Christiansen's user avatar