MappedMemoryChunk

A MemoryChunk backed by a memory-mapped file region.

On platforms that support mmap (JVM, native), this avoids loading the entire region into heap memory — the OS pages data in on demand. On platforms without mmap support (JS, Wasm), the factory falls back to reading the region into a ByteArrayMemoryChunk.

Instances are immutable from the runtime's perspective.

Inheritors

Properties

Link copied to clipboard
abstract val fileOffset: Long

The byte offset within the file where the mapping starts.

Link copied to clipboard
abstract val path: String

The file path this chunk is mapped from.