You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-8Lines changed: 24 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,9 +121,9 @@ No JNI. No annotations. No boilerplate. Just write Kotlin/Native and use it from
121
121
122
122
## What's supported
123
123
124
-
### Types — test coverage (739 end-to-end FFM tests)
124
+
### Types — test coverage (770+ end-to-end FFM tests)
125
125
126
-
Every test compiles Kotlin/Native → `libcalculator.so` (200+ exported symbols) → loads via FFM `MethodHandle` → verifies on JVM. Zero mocks — all 739 tests cross the real native boundary. Includes 25 load tests (500K+ FFM calls), concurrent stress tests (10 threads), 53 suspend function tests with cancellation, and 23 Flow tests.
126
+
Every test compiles Kotlin/Native → `libcalculator.so` (200+ exported symbols) → loads via FFM `MethodHandle` → verifies on JVM. Zero mocks — all 770+ tests cross the real native boundary. Includes 25 load tests (500K+ FFM calls), concurrent stress tests (10 threads), 53 suspend function tests with cancellation, and 50+ Flow tests (including `Flow<DataClass>`).
127
127
128
128
| Feature | As param | As return | As property | CB param | CB return | Notes |
**Cancellation**: collecting only N elements (via `take`, `first`) automatically cancels the native Flow collection. Manual `Job.cancel()` also propagates.
**Supported element types**: `Int`, `Long`, `Double`, `Float`, `Boolean`, `Byte`, `Short`, `String`, `enum class`, `Object`, `data class` (including nested data classes).
217
+
218
+
**Data class in Flow**: data classes are serialized element-by-element via `StableRef` + per-type reader bridges. Nested data classes (e.g. `Flow<Rect>` where `Rect` contains two `Point`) are fully supported.
219
+
220
+
```kotlin
221
+
// Kotlin/Native
222
+
data classMemoryInfo(valtotalMB:Long, valavailableMB:Long)
-`reachability-metadata.json`— FFM foreign downcall descriptors, reflection, and resources
446
+
-`reachability-metadata.json`— FFM foreign downcall + upcall descriptors, reflection, and resources
431
447
432
448
For GraalVM native-image builds, the native `.so`/`.dylib` must be placed next to the executable (the plugin bundles it in the JAR for JVM, but native-image can't extract at runtime).
433
449
@@ -503,7 +519,7 @@ The repository includes two complete examples in [`examples/`](examples/):
503
519
504
520
| Example | Description |
505
521
|---------|-------------|
506
-
|[`calculator/`](examples/calculator/)| Stateful Calculator class with 739 end-to-end tests: all types, callbacks, collections, suspend, Flow, nested classes, concurrency |
522
+
|[`calculator/`](examples/calculator/)| Stateful Calculator class with 770+ end-to-end tests: all types, callbacks, collections, suspend, Flow (incl. DataClass), nested classes, concurrency |
507
523
|[`systeminfo/`](examples/systeminfo/)| Linux system info (`/proc`, POSIX, `gethostname`) + native notifications via `libnotify` cinterop, with Compose Desktop UI |
0 commit comments