summaryrefslogtreecommitdiffstats
path: root/byterun
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2013-09-17 11:54:31 +0000
committerAlain Frisch <alain@frisch.fr>2013-09-17 11:54:31 +0000
commit2373f76c36193cd94bbb6707dc0ec0cfcae3ee75 (patch)
tree78476c9174a18945211629e6b5539b1ce893ad54 /byterun
parent9a4a94436389aebb4265b02f6abe49cb92baffab (diff)
#6180: efficient creation of uninitialized float arrays.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun')
-rw-r--r--byterun/array.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/byterun/array.c b/byterun/array.c
index c9d991edd..a8830d58e 100644
--- a/byterun/array.c
+++ b/byterun/array.c
@@ -135,6 +135,16 @@ CAMLprim value caml_array_unsafe_set(value array, value index, value newval)
return caml_array_unsafe_set_addr(array, index, newval);
}
+CAMLprim value caml_make_float_vect(value len)
+{
+ mlsize_t wsize = Long_val(len) * Double_wosize;
+ if (wsize == 0)
+ return Atom(0);
+ if (wsize > Max_wosize)
+ caml_invalid_argument("Array.make");
+ return caml_alloc(wsize, Double_array_tag);
+}
+
CAMLprim value caml_make_vect(value len, value init)
{
CAMLparam2 (len, init);