Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
Description
See the conversation here.
We should change MemoryAllocator to not return `null` when the requested memory length is `0`. Instead, we should create a cached "NullObject" IMemoryOwner that has a no-op `Dispose` method, and always returns `Memory<T>.Empty`.
This way consuming code doesn't need to check for `null` being returned from MemoryAllocator.Allocate.
Attachments
Issue Links
- links to