Abhilash437 opened a new pull request, #406:
URL: https://github.com/apache/arrow-dotnet/pull/406

   ## What's Changed
   
   Adds explicit XML documentation remarks (`<remarks>`) to properties and 
methods that expose `ReadOnlySpan` instances over managed or unmanaged memory 
across Apache Arrow array and buffer classes.
   
   ### Motivation & Context
   When an `ArrowBuffer` or `Array` is backed by unmanaged memory (e.g., 
allocated via a custom `MemoryAllocator` or `NativeMemoryManager`), extracting 
a `ReadOnlySpan` into a local variable and subsequently disposing the parent 
buffer/array can lead to use-after-free memory access issues. 
   
   Rather than marking these core performance APIs with `[Obsolete]` (which 
falsely signals API deprecation and fails compilation under 
`TreatWarningsAsErrors=true`), this PR implements a non-breaking documentation 
hybrid approach:
   - Added `<remarks>` warning callouts to `ArrowBuffer.Span`, 
`PrimitiveArray.Values`, `BooleanArray.Values`, and `BinaryArray.GetBytes`. 
These surface as visible safety notes in IDE tooltips and IntelliSense (Visual 
Studio, VS Code, Rider) without interrupting builds or breaking existing 
codebases.
   - Added `PoisonMemoryAllocator` and unit test 
`TestNativeMemoryManagerUseAfterFree` to `Apache.Arrow.Tests` to verify memory 
poisoning on buffer release.
   
   Closes #397.
   


-- 
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]

Reply via email to