(store Storelike, ptr *C.wasmtime_val_t)
| 159 | } |
| 160 | |
| 161 | func (v Val) initialize(store Storelike, ptr *C.wasmtime_val_t) { |
| 162 | ptr.kind = v.kind |
| 163 | switch v.kind { |
| 164 | case C.WASMTIME_I32: |
| 165 | C.go_wasmtime_val_i32_set(ptr, C.int32_t(v.val.(int32))) |
| 166 | case C.WASMTIME_I64: |
| 167 | C.go_wasmtime_val_i64_set(ptr, C.int64_t(v.val.(int64))) |
| 168 | case C.WASMTIME_F32: |
| 169 | C.go_wasmtime_val_f32_set(ptr, C.float(v.val.(float32))) |
| 170 | case C.WASMTIME_F64: |
| 171 | C.go_wasmtime_val_f64_set(ptr, C.double(v.val.(float64))) |
| 172 | case C.WASMTIME_FUNCREF: |
| 173 | val := v.val.(*Func) |
| 174 | if val != nil { |
| 175 | C.go_wasmtime_val_funcref_set(ptr, val.val) |
| 176 | } else { |
| 177 | empty := C.wasmtime_func_t{} |
| 178 | C.go_wasmtime_val_funcref_set(ptr, empty) |
| 179 | } |
| 180 | default: |
| 181 | valInitializeGC(v, store, ptr) |
| 182 | } |
| 183 | } |
no outgoing calls
no test coverage detected