arrow-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Erhardt (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ARROW-5277) [C#] MemoryAllocator.Allocate(length: 0) should not return null
Date Tue, 07 May 2019 15:46:00 GMT
Eric Erhardt created ARROW-5277:
-----------------------------------

             Summary: [C#] MemoryAllocator.Allocate(length: 0) should not return null
                 Key: ARROW-5277
                 URL: https://issues.apache.org/jira/browse/ARROW-5277
             Project: Apache Arrow
          Issue Type: Improvement
          Components: C#
            Reporter: Eric Erhardt


See the conversation [here|https://github.com/apache/arrow/pull/3925#discussion_r281187184].

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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message