Hi everybody,

to continue the discussion in [0]: right now this [1] can happen and the
sliced buffer has no way to foresee or to check against it beforehand.

I'd suggest to create a new class SlicedBuffer, which would reference the
parent buffer and return it's data() pointer, insted of grabbing the
pointer at creation. We can the parent reference a weak pointer, so the
existing SliceBuffers don't prevent the deallocation (or maybe even have a
separate WeakSliceBuffer class).

It would also make the mentioned PR way safer to merge, in my opinion.


[0]: https://github.com/apache/arrow/pull/1769
[1]: https://gist.github.com/alendit/f759bc12e03d9dd9d72cac90a6334cc5

Reply via email to