Is safe use ReadOnlyMemory across lists? #80307
-
I'm working on an send queue to an TCP socket, i will store buffer to send and task completition source, to notify if send is completed or got some error. I was using raw byte array in queue entry type. But i'm finding solutions to reduce memory usage. class QueueEntry {
public byte[] Data { get; init; }
public TaskCompletitionSource Completition { get; init; }
} If i set this |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The (RO)Memory, (like the (RO)Span) just contains the reference to the array, not a copy |
Beta Was this translation helpful? Give feedback.
The (RO)Memory, (like the (RO)Span) just contains the reference to the array, not a copy