#6180: efficient creation of uninitialized float arrays.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
9a4a944363
commit
2373f76c36
1
Changes
1
Changes
|
@ -27,6 +27,7 @@ Standard library:
|
|||
- PR#4986: add List.sort_uniq and Set.of_list
|
||||
- PR#6148: speed improvement for Buffer (patch by John Whitington)
|
||||
- PR#6146: support "Unix.kill pid Sys.sigkill" under Windows
|
||||
- PR#6180: efficient creation of uninitialized float arrays
|
||||
|
||||
Features wishes:
|
||||
- PR#4243: make the Makefiles parallelizable
|
||||
|
|
BIN
boot/ocamlc
BIN
boot/ocamlc
Binary file not shown.
BIN
boot/ocamldep
BIN
boot/ocamldep
Binary file not shown.
BIN
boot/ocamllex
BIN
boot/ocamllex
Binary file not shown.
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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} *)
|
||||
|
||||
|
|
Loading…
Reference in New Issue