realm-kotlin
realm-kotlin copied to clipboard
Support coroutine 1.6.0's freeze transparency
This PR makes our internal freeze calls a no-op when running with Kotlin's new experimental memory model. This way we avoid freezing coroutine primitive to support Coroutine 1.6.0's new freeze transparency.
NOTE: Since ktor 1.6.5 doesn't support that yet the kotlin.native.binary.freezing=disabled is still required for library-sync
Ah sorry. Missed this was still a draft 🙈 ... Use the comments for what you want.
Ah sorry. Missed this was still a draft 🙈 ... Use the comments for what you want.
Yeah. I didn't settle on whether we should use the new conditional freeze on all our freeze calls. Some of them are actually catching/freezing user provided data. If we used the new variant that only freezes data on the old memory model people could just opt into the new one if it caused troubles for them. So I guess best thing would just be to use the new freeze-variant all over, but wasn't completely ready to do that when I did the PR. Any thoughts?
- Is this being tested somehow? I assume not (outside manual testing)? But I guess there is a question about how many different memory models we want to run tests for.
We do a full test suite run with the new memory model, but the interesting parameter is actually the coroutine version. This PR enables us to run with Coroutines 1.6.0's freeze transparency without adding the kotlin.native.binary.freezing=disabled runtime flag (still required for sync as ktor also needs it) because we no-op the freeze outselves.
Superseded by https://github.com/realm/realm-kotlin/pull/1059