GeorgeLeePatterson commented on code in PR #320:
URL: https://github.com/apache/arrow-js/pull/320#discussion_r2494086240
##########
src/builder/buffer.ts:
##########
@@ -27,8 +27,10 @@ function roundLengthUpToNearest64Bytes(len: number, BPE:
number) {
/** @ignore */
function resizeArray<T extends TypedArray | BigIntArray>(arr: T, len = 0): T {
+ // Use slice() to create a copy instead of subarray() which creates a view
+ // This prevents issues where the underlying buffer might be reused/cleared
return arr.length >= len ?
- arr.subarray(0, len) as T :
+ arr.slice(0, len) as T :
Review Comment:
Ah good catch. That was a regression while battling the integration tests
locally. Will revert.
--
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]