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
+9-13Lines changed: 9 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,9 +45,8 @@ Starting from version `0.22.0` of the library your project is required to use:
45
45
* Code it like a boxed value `atomic(0)`, but run it in production efficiently:
46
46
* as `java.util.concurrent.atomic.AtomicXxxFieldUpdater` on Kotlin/JVM
47
47
* as a plain unboxed value on Kotlin/JS
48
-
* Multiplatform: write common Kotlin code with atomics that compiles for Kotlin JVM, JS, and Native backends:
49
-
* Compile-only dependency for JVM and JS (no runtime dependencies)
50
-
* Compile and runtime dependency for Kotlin/Native
48
+
* as Kotlin/Native atomic intrinsics on Kotlin/Native
49
+
* Multiplatform: write common Kotlin code with atomics that compiles for Kotlin JVM, JS, and Native backends.
51
50
* Use Kotlin-specific extensions (e.g. inline `loop`, `update`, `updateAndGet` functions).
52
51
* Use atomic arrays, user-defined extensions on atomics and locks (see [more features](#more-features)).
53
52
*[Tracing operations](#tracing-operations) for debugging.
@@ -248,17 +247,13 @@ public var foo: T by _foo // public delegated property (val/var)
248
247
(more specifically, `complex_expression` should not have branches in its compiled representation).
249
248
Extract `complex_expression` into a variable when needed.
250
249
251
-
## Transformation modes
250
+
## Atomicfu compiler plugin
252
251
253
-
Basically, Atomicfu library provides an effective usage of atomic values by performing the transformations of the compiled code.
254
-
For JVM and JS there 2 transformation modes available:
255
-
***Post-compilation transformation** that modifies the compiled bytecode or `*.js` files.
256
-
***IR transformation** that is performed by the atomicfu compiler plugin.
257
-
258
-
### Atomicfu compiler plugin
259
-
260
-
Compiler plugin transformation is less fragile than transformation of the compiled sources
261
-
as it depends on the compiler IR tree.
252
+
To provide a user-friendly atomic API on the frontend and effective usage of atomic values on the backend kotlinx-atomicfu library uses the compiler plugin to transform
253
+
IR for all the target backends:
254
+
***JVM**: atomics are replaced with `java.util.concurrent.atomic.AtomicXxxFieldUpdater`.
255
+
***Native**: atomics are implemented via atomic intrinsics on Kotlin/Native.
256
+
***JS**: atomics are unboxed and represented as plain values.
262
257
263
258
To turn on IR transformation set these properties in your `gradle.properties` file:
264
259
@@ -267,6 +262,7 @@ To turn on IR transformation set these properties in your `gradle.properties` fi
267
262
268
263
```groovy
269
264
kotlinx.atomicfu.enableJvmIrTransformation=true // for JVM IR transformation
265
+
kotlinx.atomicfu.enableNativeIrTransformation=true // for Native IR transformation
270
266
kotlinx.atomicfu.enableJsIrTransformation=true // for JS IR transformation
Copy file name to clipboardExpand all lines: integration-testing/src/functionalTest/kotlin/kotlinx.atomicfu.gradle.plugin.test/framework/checker/ArtifactChecker.kt
Copy file name to clipboardExpand all lines: integration-testing/src/functionalTest/kotlin/kotlinx.atomicfu.gradle.plugin.test/framework/checker/DependenciesChecker.kt
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,19 @@ internal fun GradleBuild.checkMppJvmCompileOnlyDependencies() {
0 commit comments