aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/runtime/runtime_wasm_unknown.go
blob: 111bddf085ffb70e714295d5d13ddd2db7c1b4a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//go:build wasm_unknown

package runtime

import "unsafe"

type timeUnit int64

// libc constructors
//
//export __wasm_call_ctors
func __wasm_call_ctors()

//export _initialize
func _initialize() {
	// These need to be initialized early so that the heap can be initialized.
	heapStart = uintptr(unsafe.Pointer(&heapStartSymbol))
	heapEnd = uintptr(wasm_memory_size(0) * wasmPageSize)
	initAll()
}

func init() {
	__wasm_call_ctors()
}

var args []string

func ticksToNanoseconds(ticks timeUnit) int64 {
	return int64(ticks)
}

func nanosecondsToTicks(ns int64) timeUnit {
	return timeUnit(ns)
}

// with the wasm32-unknown-unknown target there is no way to determine any `precision`
const timePrecisionNanoseconds = 1000

func sleepTicks(d timeUnit) {
}

func ticks() timeUnit {
	return timeUnit(0)
}