slice

fun slice(offset: Int, length: Int): Memory
fun slice(offset: Long, length: Long): Memory

Returns memory’s subrange. On some platforms it could do range checks but it is not guaranteed to be safe. It also could lead to memory allocations on some platforms.