target/wasm_unknown: remove bulk memory and use imported memory for extreme tinyness

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2024-02-15 14:33:24 +01:00
committed by Ron Evans
parent 186018abeb
commit 5879d785a9
4 changed files with 9 additions and 14 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build tinygo.wasm && !custommalloc
//go:build tinygo.wasm && !(custommalloc || wasm_unknown)
package runtime
+1 -2
View File
@@ -31,10 +31,9 @@ func abort() {
//go:linkname syscall_Exit syscall.Exit
func syscall_Exit(code int) {
//proc_exit(uint32(code))
}
// TinyGo does not yet support any form of parallelism on WebAssembly, so these
// There is not yet any support for any form of parallelism on WebAssembly, so these
// can be left empty.
//go:linkname procPin sync/atomic.runtime_procPin
+3 -8
View File
@@ -2,9 +2,7 @@
package runtime
import (
"unsafe"
)
import "unsafe"
type timeUnit int64
@@ -21,10 +19,6 @@ func _start() {
run()
}
// Read the command line arguments from WASI.
// For example, they can be passed to a program with wasmtime like this:
//
// wasmtime run ./program.wasm arg1 arg2
func init() {
__wasm_call_ctors()
}
@@ -39,7 +33,8 @@ func nanosecondsToTicks(ns int64) timeUnit {
return timeUnit(ns)
}
const timePrecisionNanoseconds = 1000 // TODO: how can we determine the appropriate `precision`?
// with the wasm32-unknown-unknown target there is no way to determine any `precision`
const timePrecisionNanoseconds = 1000
func sleepTicks(d timeUnit) {
}