Skip to content

refactor: share primitive length, LE-segment and chunked-combine helpers - #448

Merged
dfa1 merged 1 commit into
mainfrom
refactor/primitive-carrier-helpers
Oct 3, 2026
Merged

dfa1 merged 1 commit into
mainfrom
refactor/primitive-carrier-helpers

Conversation

@dfa1

@dfa1 dfa1 commented Oct 3, 2026

Copy link
Copy Markdown
Owner
  • Six writer encoders each switched over ptype just to read a carrier
    array's length; they now call java.lang.reflect.Array.getLength.
  • Zstd and Primitive both hand-rolled per-element loops copying a heap
    carrier into a little-endian segment; PrimitiveArrays.toSegment does
    it with one bulk MemorySegment.copy, aligned to the element width.
    Primitive still wraps byte[] in place.
  • ChunkedEncodingDecoder duplicated ChunkedArrayCombiner's primitive
    switch; it now calls ChunkedArrayCombiner.combinePrimitive.

Verified with ./mvnw verify (unit + integration).

🤖 Generated with Claude Code

- Six writer encoders each switched over ptype just to read a carrier
  array's length; they now call java.lang.reflect.Array.getLength.
- Zstd and Primitive both hand-rolled per-element loops copying a heap
  carrier into a little-endian segment; PrimitiveArrays.toSegment does
  it with one bulk MemorySegment.copy, aligned to the element width.
  Primitive still wraps byte[] in place.
- ChunkedEncodingDecoder duplicated ChunkedArrayCombiner's primitive
  switch; it now calls ChunkedArrayCombiner.combinePrimitive.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dfa1
dfa1 merged commit 08f16c8 into main Oct 3, 2026
6 checks passed
@dfa1
dfa1 deleted the refactor/primitive-carrier-helpers branch October 3, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant