summaryrefslogtreecommitdiffstats
path: root/stdlib
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 /stdlib
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 'stdlib')
-rw-r--r--stdlib/array.ml1
-rw-r--r--stdlib/array.mli3
2 files changed, 4 insertions, 0 deletions
diff --git a/stdlib/array.ml b/stdlib/array.ml
index 68c203315..1990a78b8 100644
--- a/stdlib/array.ml
+++ b/stdlib/array.ml
@@ -25,6 +25,7 @@ external append_prim : 'a array -> 'a array -> 'a array = "caml_array_append"
external concat : 'a array list -> 'a array = "caml_array_concat"
external unsafe_blit :
'a array -> int -> 'a array -> int -> int -> unit = "caml_array_blit"
+external make_float: int -> float array = "caml_make_float_vect"
let init l f =
if l = 0 then [||] else
diff --git a/stdlib/array.mli b/stdlib/array.mli
index 6913e2eb6..7c0049e28 100644
--- a/stdlib/array.mli
+++ b/stdlib/array.mli
@@ -150,6 +150,9 @@ val fold_right : ('b -> 'a -> 'a) -> 'b array -> 'a -> 'a
[f a.(0) (f a.(1) ( ... (f a.(n-1) x) ...))],
where [n] is the length of the array [a]. *)
+external make_float: int -> float array = "caml_make_float_vect"
+(** [Array.make_float n] returns a fresh float array of length [n],
+ with uninitialized data. *)
(** {6 Sorting} *)