Repository navigation
Conversation
UInt64[][] is an Array<ULongArray> in Kotlin, and its JVM class names kotlin.ULongArray, which JNI cannot name. It crossed as an Array<LongArray>, so Kotlin mapped it on every crossing and created a ULongArray box for each row. JNI now creates the ULongArray[] itself with the class from ULongBox, puts each row's long[] in a box with AllocObject and the box's field, and reads rows the same way. JNI signatures declare the array as an Object[], so Kotlin bridges take an Array<*> and cast it back without copying. Struct getters return the field as it is. Structs compared these fields through the JNI conversion, which is now a cast. Types give structs an equality value instead, so the generated equals() and hashCode() are unchanged. Arrays nested more than two levels deep still map their outer levels in Kotlin. New TestObject methods pass UInt64[][] as a Promise result and through a callback.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
mrousavy
added this pull request to stack #2000
October 23, 2026 18:13
This was referenced Oct 23, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fourth of five stacked PRs: #1997 → #1998 → #1999 → #2008 (this one) → #2009.
UInt64[][]is anArray<ULongArray>in Kotlin. Its JVM class nameskotlin.ULongArray, which JNI can't name (see #1999), so it crossed as anArray<LongArray>and Kotlin mapped it on every crossing, creating oneULongArraybox per row.JNI now builds it itself. It creates the
ULongArray[]with the class fromULongBox, puts each row'slong[]into a box withAllocObjectand the box's field, and reads rows back the same way, both for C++ values and straight from JS. JNI signatures declare the array as anObject[](JULongArrays), so the Kotlin bridges take anArray<*>and cast it back with@Suppress("UNCHECKED_CAST"), which always holds since JNI created aULongArray[]. Struct getters return the field as is. Arrays nested more than two levels deep still map their outer levels in Kotlin.Generated structs compared these fields through the JNI conversion, which is now a cast. Types give structs an equality value instead (
getKotlinEqualityValue()replacesisKotlinEqualityCompatible), so the generatedequals()andhashCode()are unchanged.New
TestObjectmethods passUInt64[][]as a Promise result and through a callback.Validation: Kotlin compiles without warnings, and every generated JNI source of nitro-test and nitro-test-external compiles with the NDK. I did not run the runtime tests locally.
🤖 Generated with Claude Code