zeroshade opened a new pull request, #1431:
URL: https://github.com/apache/arrow-go/pull/1431

   ### Rationale for this change
   
   SortIndices allocates temporary index buffers for single-column chunked 
sorting, null/NaN partitioning, and multi-key sorting without releasing them. A 
checked allocator reports outstanding memory even after callers release the 
returned indices.
   
   ### What changes are included in this PR?
   
   - Defer Release immediately after each of the three previously unreleased 
scratch allocations, matching the existing integer radix-sort pattern.
   - Preserve ownership of the output buffer, which is transferred to the 
returned result.
   - Add checked-allocator regression coverage for an array with nulls, a 
float64 array with NaN, a multi-chunk array, a multi-key record batch, and a 
multi-key multi-chunk table. Each case also checks the resulting permutation.
   - Document temporary-buffer lifetime and result ownership on SortIndices.
   
   ### Are these changes tested?
   
   Yes. Before the fix, `go test ./arrow/compute -run 
'^TestSortIndicesReleasesScratchBuffers$' -count=1` failed on upstream/main 
with the new test added: all five subtests reported a 64-byte leak from 
`exec.(*KernelCtx).Allocate`.
   
   After the fix, `go test ./arrow/compute/... -count=1` passed for all four 
packages, including the new regression test.
   
   ### Are there any user-facing changes?
   
   Sort operations no longer leak temporary allocator-backed scratch buffers. 
Sort order and API signatures are unchanged; callers still own and must release 
returned results.
   


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