Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix returning arrays of primitives not being properly sized in Java #328

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

mrousavy
Copy link
Owner

@mrousavy mrousavy commented Nov 12, 2024

When returning arrays of primitives (DoubleArray, BooleanArray, BigIntArray) from Java, we used getRegion from the primitive array to copy it directly into the std::vector::data().

The problem with that is that data() will not be properly sized in our case because we used std::vector::reserve(..) beforehand - instead of constructing the std::vector with a fixed size already.

This PR fixes that.

Copy link

vercel bot commented Nov 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
nitro-docs ⬜️ Skipped (Inspect) Nov 12, 2024 7:14pm

@mrousavy mrousavy merged commit c027f54 into main Nov 12, 2024
13 checks passed
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