Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karmakrafts/multiplatform-mman
Lightweight wrapper around mman for Linux, Windows and macOS.
https://github.com/karmakrafts/multiplatform-mman
api kotlin kotlin-library kotlin-multiplatform kotlin-native library linux macos memory memory-management memory-mapped-file memory-mapping mingw mmio osx windows
Last synced: 2 days ago
JSON representation
Lightweight wrapper around mman for Linux, Windows and macOS.
- Host: GitHub
- URL: https://github.com/karmakrafts/multiplatform-mman
- Owner: karmakrafts
- License: apache-2.0
- Created: 2024-11-08T22:56:16.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2025-02-16T00:40:30.000Z (5 days ago)
- Last Synced: 2025-02-16T01:19:49.662Z (5 days ago)
- Topics: api, kotlin, kotlin-library, kotlin-multiplatform, kotlin-native, library, linux, macos, memory, memory-management, memory-mapped-file, memory-mapping, mingw, mmio, osx, windows
- Language: Kotlin
- Homepage: https://git.karmakrafts.dev/kk/multiplatform-mman
- Size: 203 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Multiplatform mman
[](https://git.karmakrafts.dev/kk/multiplatform-mman/-/pipelines)
[](https://git.karmakrafts.dev/kk/multiplatform-mman/-/packages)Lightweight wrapper around mman for Kotlin/Native to allow for easy MMIO.
### Platform support
* Windows x64
* Linux x64
* Linux arm64
* macOS x64
* macOS arm64
* iOS x64
* iOS arm64
* Android Native x64
* Android Native arm64
* Android Native arm32### How to use it
First, add a dependency on the library:
```kotlin
repositories {
maven("https://files.karmakrafts.dev/maven")
}kotlin {
sourceSets {
commonMain {
dependencies {
implementation("io.karma.mman:multiplatform-mman:")
}
}
}
}
```Afterwards, you can access all APIs from any native source set:
```kotlin
import io.karma.mman.AccessFlags
import io.karma.mman.AccessFlags.Companion
import io.karma.mman.MemoryRegionfun main() {
MemoryRegion.map(path, AccessFlags.READ + AccessFlags.WRITE).use {
it.asSource() // Consume data through a kotlinx.io.Source
it.asSink() // Produce data through a kotlinx.io.Sink
}
}
```