How OCaml creates an arrry

Hi,

I am very new to OCaml and have been learning basic stuff lately. I found the following in standard lib source ‘array.ml’.
external create: int -> 'a -> 'a array = "caml_make_vect"
I assume that ‘external’ means calling an external library.
I’d like to know which external lib and how actaully OCaml creates an array on memory.

Thank you in advance.
Regards,
Jazz

Hi, the OCaml Manual covers externals here: Chapter 20  Interfacing C with OCaml

See also the definition of caml_make_vect here: ocaml/array.c at 181e7c7cd5153c95a1bb9258a2372f3f8e151467 · ocaml/ocaml · GitHub

3 Likes

Thank you, Yawaramin.