Skip to content

Commit

Permalink
caml_make_vec
Browse files Browse the repository at this point in the history
  • Loading branch information
chambart committed Oct 9, 2024
1 parent 04adea2 commit 0750771
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wasm/imports.wat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(type $Float (sub (struct (field (mut f64)))))
(type $Int64 (struct (field (mut i64))))
(type $String (sub (array (mut i8))))
(type $Array (sub (array (mut (ref eq)))))
(type $Gen_block (sub (array (mut (ref eq)))))


Expand Down Expand Up @@ -576,7 +577,11 @@
;; Array
;; =====

(func (export "caml_make_vect") (param (ref eq)) (param (ref eq)) (result (ref eq)) (unreachable))
(func (export "caml_make_vect") (param $size (ref eq)) (param $value (ref eq)) (result (ref eq))
(array.new $Array
(local.get $value)
(i31.get_s (ref.cast (ref i31) (local.get $size))))
)
(func (export "caml_make_float_vect") (param (ref eq)) (result (ref eq)) (unreachable))
(func (export "caml_array_sub") (param (ref eq)) (param (ref eq)) (param (ref eq)) (result (ref eq)) (unreachable))
(func (export "caml_array_append") (param (ref eq)) (param (ref eq)) (result (ref eq)) (unreachable))
Expand Down

0 comments on commit 0750771

Please sign in to comment.