1
(***********************************************************************)
5
(* Pierre Weis, projet Cristal, INRIA Rocquencourt *)
7
(* Copyright 2001 Institut National de Recherche en Informatique et *)
8
(* en Automatique. All rights reserved. This file is distributed *)
9
(* only by permission. *)
11
(***********************************************************************)
13
(* Module [Realloc]: reallocation of vectors. *)
15
(* File realloc.ml contains the implementation of module [Realloc]. *)
18
let l = Array.length v in
20
if l = 0 then invalid_arg "cannot realloc empty vectors" else
21
let res = Array.make n v.(0) in
22
Array.blit v 1 res 1 (l - 1);