From 2330a3b30fe5b910f4776bf9c41f35ce2b980fb1 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Mon, 9 Apr 2012 10:23:50 +0000 Subject: PR#3571: in Bigarrays, call msync() before unmapping to commit changes PR#5463: Bigarray.*.map_file fail if empty array is requested Bigarray: added "release" functions that free memory and file mappings just like GC finalization does eventually, but does it immediately. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12327 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- otherlibs/bigarray/bigarray.ml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'otherlibs/bigarray/bigarray.ml') diff --git a/otherlibs/bigarray/bigarray.ml b/otherlibs/bigarray/bigarray.ml index 1d3dbcf97..b9f22b182 100644 --- a/otherlibs/bigarray/bigarray.ml +++ b/otherlibs/bigarray/bigarray.ml @@ -99,6 +99,8 @@ module Genarray = struct = "caml_ba_map_file_bytecode" "caml_ba_map_file" let map_file fd ?(pos = 0L) kind layout shared dims = map_internal fd kind layout shared dims pos + external release: ('a, 'b, 'c) t -> unit + = "caml_ba_release" end module Array1 = struct @@ -122,6 +124,8 @@ module Array1 = struct ba let map_file fd ?pos kind layout shared dim = Genarray.map_file fd ?pos kind layout shared [|dim|] + external release: ('a, 'b, 'c) t -> unit + = "caml_ba_release" end module Array2 = struct @@ -161,6 +165,8 @@ module Array2 = struct ba let map_file fd ?pos kind layout shared dim1 dim2 = Genarray.map_file fd ?pos kind layout shared [|dim1;dim2|] + external release: ('a, 'b, 'c) t -> unit + = "caml_ba_release" end module Array3 = struct @@ -210,6 +216,8 @@ module Array3 = struct ba let map_file fd ?pos kind layout shared dim1 dim2 dim3 = Genarray.map_file fd ?pos kind layout shared [|dim1;dim2;dim3|] + external release: ('a, 'b, 'c) t -> unit + = "caml_ba_release" end external genarray_of_array1: ('a, 'b, 'c) Array1.t -> ('a, 'b, 'c) Genarray.t -- cgit v1.2.3-70-g09d2