[Wasm] Wasi stdlib implementation

KT-56608
This commit is contained in:
Igor Yakovlev
2023-07-31 14:27:09 +02:00
committed by Zalim Bashorov
parent 090f393f97
commit 8cc0660693
61 changed files with 817 additions and 103 deletions
@@ -3,9 +3,6 @@ package test.wasm.unsafe
import kotlin.wasm.unsafe.*
import kotlin.test.*
private fun jsConcatStrings(a: String, b: String): String =
js("a + b")
@OptIn(UnsafeWasmMemoryApi::class)
class MemoryAllocationTest {
val pageSize = 65_536
@@ -128,14 +125,6 @@ class MemoryAllocationTest {
assertTrue(max1 < min1_1)
}
@Test
fun testJsIntropInsideAllocations() {
withScopedMemoryAllocator { allocator ->
assertEquals(jsConcatStrings("str1", "str2"), "str1str2")
allocator.allocate(10)
}
}
@Test
fun testNestedAllocatorThrows() {
var leakedAllocator1: MemoryAllocator? = null