Skip to content

Commit

Permalink
Delete the deprecated Bigarray.*.map_file functions
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
  • Loading branch information
jeremiedimino committed Feb 25, 2019
1 parent 4fd7020 commit b0d2151
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 94 deletions.
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -32,6 +32,9 @@ Working version
unbound Unix socket. Add support for receiving abstract (Linux) socket paths.
(Tim Cuthbertson, review by Sébastien Hinderer and Jérémie Dimino)

- GRP#2263: Delete the deprecated Bigarray.*.map_file functions
(Jérémie Dimino)

OCaml 4.08.0
------------

Expand Down
13 changes: 1 addition & 12 deletions otherlibs/bigarray/Makefile
Expand Up @@ -14,22 +14,11 @@
#**************************************************************************

LIBNAME=bigarray
EXTRACFLAGS=-I../$(UNIXLIB) -DIN_OCAML_BIGARRAY
EXTRACAMLFLAGS=-I ../$(UNIXLIB)
COBJS=mmap_ba.$(O) mmap.$(O)
CAMLOBJS=bigarray.cmo
COBJS=empty.$(O)

include ../Makefile.otherlibs.common

ifeq "$(SYSTEM)" "mingw"
LDOPTS=-ldopt "-link -static-libgcc"
endif

mmap.$(O): ../$(UNIXLIB)/mmap.c
$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<
mmap_ba.$(O): ../unix/mmap_ba.c
$(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $<

.PHONY: depend

depend:
Expand Down
38 changes: 1 addition & 37 deletions otherlibs/bigarray/bigarray.ml
Expand Up @@ -12,40 +12,4 @@
(* *)
(**************************************************************************)

module Super = Stdlib.Bigarray

include (Super : module type of struct include Super end
with module Genarray := Super.Genarray
with module Array1 := Super.Array1
with module Array2 := Super.Array2
with module Array3 := Super.Array3)

module Genarray = struct
include Super.Genarray
external map_internal: Unix.file_descr -> ('a, 'b) kind -> 'c layout ->
bool -> int array -> int64 -> ('a, 'b, 'c) t
= "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
end

module Array1 = struct
include Super.Array1
let map_file fd ?pos kind layout shared dim =
array1_of_genarray
(Genarray.map_file fd ?pos kind layout shared [|dim|])
end

module Array2 = struct
include Super.Array2
let map_file fd ?pos kind layout shared dim1 dim2 =
array2_of_genarray
(Genarray.map_file fd ?pos kind layout shared [|dim1;dim2|])
end

module Array3 = struct
include Super.Array3
let map_file fd ?pos kind layout shared dim1 dim2 dim3 =
array3_of_genarray
(Genarray.map_file fd ?pos kind layout shared [|dim1;dim2;dim3|])
end
include Stdlib.Bigarray
45 changes: 0 additions & 45 deletions otherlibs/bigarray/bigarray.mli
Expand Up @@ -13,48 +13,3 @@
(**************************************************************************)

include module type of struct include Stdlib.Bigarray end
with module Genarray := Stdlib.Bigarray.Genarray
with module Array1 := Stdlib.Bigarray.Array1
with module Array2 := Stdlib.Bigarray.Array2
with module Array3 := Stdlib.Bigarray.Array3

module Genarray : sig
include module type of struct include Stdlib.Bigarray.Genarray end
val map_file:
Unix.file_descr -> ?pos:int64 -> ('a, 'b) kind -> 'c layout ->
bool -> int array -> ('a, 'b, 'c) t
[@@ocaml.deprecated "\
Use Unix.map_file instead.\n\
Note that Bigarray.Genarray.map_file raises Sys_error while\n\
Unix.map_file raises Unix_error."]
end

module Array1 : sig
include module type of struct include Stdlib.Bigarray.Array1 end
val map_file: Unix.file_descr -> ?pos:int64 -> ('a, 'b) kind -> 'c layout ->
bool -> int -> ('a, 'b, 'c) t
[@@ocaml.deprecated "\
Use [array1_of_genarray (Unix.map_file ...)] instead.\n\
Note that Bigarray.Array1.map_file raises Sys_error while\n\
Unix.map_file raises Unix_error."]
end

module Array2 : sig
include module type of struct include Stdlib.Bigarray.Array2 end
val map_file: Unix.file_descr -> ?pos:int64 -> ('a, 'b) kind -> 'c layout ->
bool -> int -> int -> ('a, 'b, 'c) t
[@@ocaml.deprecated "\
Use [array2_of_genarray (Unix.map_file ...)] instead.\n\
Note that Bigarray.Array2.map_file raises Sys_error while\n\
Unix.map_file raises Unix_error."]
end

module Array3 : sig
include module type of struct include Stdlib.Bigarray.Array3 end
val map_file: Unix.file_descr -> ?pos:int64 -> ('a, 'b) kind -> 'c layout ->
bool -> int -> int -> int -> ('a, 'b, 'c) t
[@@ocaml.deprecated "\
Use [array3_of_genarray (Unix.map_file ...)] instead.\n\
Note that Bigarray.Array3.map_file raises Sys_error while\n\
Unix.map_file raises Unix_error."]
end
Empty file added otherlibs/bigarray/empty.c
Empty file.

0 comments on commit b0d2151

Please sign in to comment.