diff --git a/CHANGELOG.md b/CHANGELOG.md index e7d4014..6924520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Change Log +## 0.5.0 + +This release adds support for new native memory model and drops support for the old one. Many thanks to @dcvz for the contribution. + +### Added +- Synchronize cache loader by key - [#15](https://github.com/ReactiveCircus/cache4k/pull/15) +- Support new native memory model and drop support for old memory model - [#17](https://github.com/ReactiveCircus/cache4k/pull/17) + +### Changed + +- Kotlin 1.6.20. +- Coroutines 1.6.1 + ## 0.4.0 ### Added diff --git a/README.md b/README.md index d320e91..232ddeb 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ In-memory Cache for Kotlin Multiplatform. **cache4k** provides a simple in-memory key-value cache for **Kotlin Multiplatform**, with support for time-based (expiration) and size-based evictions. +**Note that only the new Kotlin Native memory model is supported.** + The following targets are currently supported: - jvm diff --git a/cache4k/src/commonMain/kotlin/io/github/reactivecircus/cache4k/RealCache.kt b/cache4k/src/commonMain/kotlin/io/github/reactivecircus/cache4k/RealCache.kt index 862c4f2..f9cbbb6 100644 --- a/cache4k/src/commonMain/kotlin/io/github/reactivecircus/cache4k/RealCache.kt +++ b/cache4k/src/commonMain/kotlin/io/github/reactivecircus/cache4k/RealCache.kt @@ -217,7 +217,7 @@ internal class RealCache( private fun recordRead(cacheEntry: CacheEntry) { if (expiresAfterAccess) { val accessTimeMark = cacheEntry.accessTimeMark.value - cacheEntry.accessTimeMark.update { (accessTimeMark + accessTimeMark.elapsedNow()) } + cacheEntry.accessTimeMark.update { accessTimeMark + accessTimeMark.elapsedNow() } } accessQueue?.addLastOrReorder(cacheEntry) } diff --git a/gradle.properties b/gradle.properties index 9582da6..b0656f1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=io.github.reactivecircus.cache4k -VERSION_NAME=0.5.0-SNAPSHOT +VERSION_NAME=0.5.0 POM_URL=https://github.com/reactivecircus/cache4k POM_SCM_URL=https://github.com/reactivecircus/cache4k