CurtHagenlocher opened a new pull request, #536: URL: https://github.com/apache/arrow-dotnet/pull/536
## What's Changed `Slice` returns a view that shares the original's buffers without keeping them alive. `SliceShared` returns one that reference-counts them. Only `ArrayData.Slice` documented this. `RecordBatch.Slice`, `ChunkedArray.Slice`, `Column.Slice` and `ArrowArrayFactory.Slice` had no docs, and `Array.Slice` didn't point to `SliceShared`. Because `Slice` is the more obvious name, it's easy to assume it keeps the memory alive. adbc-drivers/databricks#813 is a real case: the driver sliced a `RecordBatch`, disposed the original, and then read freed string data. This PR documents every `Slice` overload the same way: - it is valid only until the original is disposed; - what disposing the result does. For `ArrayData`, `Array`, `ArrowArrayFactory` and `RecordBatch`, disposing the slice can release the shared buffers and so invalidate the original. `ChunkedArray` and `Column` slices don't dispose what they hold; - use `SliceShared` for a slice that outlives the original. It also adds docs to the `SliceShared` overloads that had none (`RecordBatch`, `ArrowArrayFactory`, `ChunkedArray.SliceShared(long)`). Docs only; no behavior changes. I built with `GenerateDocumentationFile=true`, and every new `cref` resolves. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
