During code review I've encountered several places with unsafe or unusual disposal patterns or just outright missing Dispose() calls after all. I think it might be worth to include IDisposableAnalyzers to catch these places early on.
On top the implementation of MemoryBufferWriter should be revisited. This class implements Stream for no apparent reason since its main use is in the form of IBufferWriter<byte> for MessagePack. The caching pattern implemented there looks error prone to me given that this type is using the disposal pattern.
During code review I've encountered several places with unsafe or unusual disposal patterns or just outright missing
Dispose()calls after all. I think it might be worth to include IDisposableAnalyzers to catch these places early on.On top the implementation of
MemoryBufferWritershould be revisited. This class implementsStreamfor no apparent reason since its main use is in the form ofIBufferWriter<byte>for MessagePack. The caching pattern implemented there looks error prone to me given that this type is using the disposal pattern.