[Wasm][Stdlib] Use array copy in String.toCharArray()

And don't use copy during internal non-mutating algorithms
This commit is contained in:
Svyatoslav Kuzmich
2021-10-21 12:48:43 +03:00
parent 79b98f9173
commit baa53b5cf3
2 changed files with 2 additions and 2 deletions
@@ -14,7 +14,7 @@ internal fun exportString(src: String?): Int {
val retAddr = unsafeGetScratchRawMemory(INT_SIZE_BYTES + src.length * CHAR_SIZE_BYTES)
wasm_i32_store(retAddr, src.length)
unsafeCharArrayToRawMemory(src.toCharArray(), retAddr + INT_SIZE_BYTES)
unsafeCharArrayToRawMemory(src.chars, retAddr + INT_SIZE_BYTES)
return retAddr
}