Skip to content

Commit a597e15

Browse files
committed
Changes to support and test new memory model
1 parent 3938087 commit a597e15

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,7 @@ jobs:
4747
- name: Build
4848
run: ./gradlew build --no-daemon --stacktrace
4949

50+
- name: Build New Memory Model
51+
run: ./gradlew build --no-daemon --stacktrace -Pkotlin.native.binary.memoryModel=experimental
5052
env:
5153
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kotlin.code.style=official
22

33
GROUP=co.touchlab
44
VERSION_NAME=1.0.11
5-
KOTLIN_VERSION=1.6.10
5+
KOTLIN_VERSION=1.6.20-RC2
66

77
kotlin.native.ignoreDisabledTargets=true
88

sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/concurrency/SingleThreadDatabaseConnection.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import kotlin.native.concurrent.ensureNeverFrozen
2222
class SingleThreadDatabaseConnection(delegateConnection: DatabaseConnection):DatabaseConnection by delegateConnection
2323
{
2424
init {
25-
ensureNeverFrozen()
25+
if (Platform.memoryModel == MemoryModel.STRICT)
26+
ensureNeverFrozen()
2627
}
2728
}

sqliter-driver/src/nativeCommonTest/kotlin/co/touchlab/sqliter/concurrency/ConcurrentDatabaseConnectionTest.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,12 @@ class ConcurrentDatabaseConnectionTest {
7171

7272
@Test
7373
fun singleThreadedConnectionFreezeFails() {
74+
// Skip if not strict
75+
if (Platform.memoryModel != MemoryModel.STRICT) {
76+
return
77+
}
7478
basicTestDb(TWO_COL) {
75-
var conn = it.createSingleThreadedConnection()
79+
val conn = it.createSingleThreadedConnection()
7680
try {
7781
assertFails { conn.freeze() }
7882
} catch (assertion: AssertionError) {

0 commit comments

Comments
 (0)