Commits

ptaylor authored 853742021ce
ARROW-5100: [JS] Remove swap while collapsing contiguous buffers Fixes https://issues.apache.org/jira/browse/ARROW-5100 Seems like this is a fairly rare edge case, but really perplexing when it happens. I saw it when manually creating Arrow Columns from data sliced out of an ArrayBuffer pool, and just so happened to get an overlapping + out-of-order set of buffers. I added a test case that demonstrates the issue too. Description from the issue: > We collapse contiguous Uint8Arrays that share the same underlying ArrayBuffer and have overlapping byte ranges. This was done to maintain true zero-copy behavior when using certain node core streams that use a buffer pool internally, and could write chunks of the same logical Arrow Message at out-of-order byte offsets in the pool. > Unfortunately this can also lead to a bug where, in rare cases, buffers are swapped while writing Arrow Messages too. We could have a flag to indicate whether we think collapsing out-of-order same-buffer chunks is safe, but I'm not sure if we can always know that, so I'd prefer to take it out and incur the copy cost. Author: ptaylor <paul.e.taylor@me.com> Closes #4102 from trxcllnt/js/no-buffer-swap and squashes the following commits: 0aaf813d <ptaylor> ensure built asset names match the js version 2a5c5d51 <ptaylor> remove swap behavior from contiguous buffer collapse for safety