Karakatiza666 commented on PR #438:
URL: https://github.com/apache/arrow-js/pull/438#issuecomment-4587669795

   You're right, I've pushed the updated commit. This version keeps the reader 
zero-copy for everything under 2^53 and only falls back to a copy for when the 
fallback rebase is necessary:
   
   - Final offset ≤ 2^53 (common): offsets returned as a zero-copy 
BigInt64Array view over the wire bytes — no allocation, no copy. Narrowing to 
number stays lazy (at element access) and is always lossless.
   - Final offset > 2^53, span ≤ 2^53 (slice with absolute offsets): rebased to 
0 in bigint precision into a fresh buffer — the only path that copies — so the 
values stay narrowable.
   - Final offset > 2^53, span > 2^53: unreachable in practice — needs a child 
buffer > 2^53 elements present in the message, far past any engine's allocation 
limit.
   - bigIntToNumber 2^53 guard: after the rebase, never tripped by well-formed 
wire data; only reachable via hand-built in-memory Data (makeData, not rebased 
by design) — a loud failure for corrupt input.
   - Offset < 2^53 but past the child buffer: clamps silently in subarray/slice 
(pre-existing - built in methods behavior, unchanged).


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