summaryrefslogtreecommitdiffstats
path: root/otherlibs/bigarray/bigarray.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2012-04-09 10:23:50 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2012-04-09 10:23:50 +0000
commit2330a3b30fe5b910f4776bf9c41f35ce2b980fb1 (patch)
tree2a4daf18833123751ad9a41292895073b7bbf5f9 /otherlibs/bigarray/bigarray.ml
parent0d2e9941ebfbfcaaf28eae3e21dd7a8d35fdbb91 (diff)
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
Diffstat (limited to 'otherlibs/bigarray/bigarray.ml')
-rw-r--r--otherlibs/bigarray/bigarray.ml8
1 files changed, 8 insertions, 0 deletions
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