jvanstraten commented on a change in pull request #12116:
URL: https://github.com/apache/arrow/pull/12116#discussion_r802865182
##########
File path: cpp/src/arrow/memory_pool.h
##########
@@ -63,6 +63,42 @@ class MemoryPoolStats {
/// take care of the required 64-byte alignment.
class ARROW_EXPORT MemoryPool {
public:
+ class ARROW_EXPORT ImmutableZeros {
Review comment:
I think you're right, actually. My reasoning for introducing it was that
I needed something to model shared ownership of a region of zero-allocated
(virtual) memory for a bunch of Buffers (`ImmutableZerosPoolBuffer`
specifically, as created using `MakeBufferOfZeros()`), so some RAII object
inside a `shared_ptr` would do the trick. I didn't even consider that that RAII
object could also just be a Buffer implementation, with its implementation
details hidden that way. It felt very wrong to define a public class for
something this specific in such a prominent place to begin with, so I'm glad to
get rid of it... The current `ImmutableZerosPoolBuffer` class could then be
used much more generically for shared-ownership views of some buffer, unless
that already exists (?), in which case I can just reuse that.
I don't think I'll get around to refactoring this today, but I'll take a
closer look tomorrow (and then rebase after that).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]