Skip to content

Commit 7cfde7f

Browse files
authored
Merge pull request #299 from hannesm/no-mmap
since cstruct-unix requires 4.08+, no need for mmap -- use Unix.map_file directly
2 parents 407f1c1 + 2bb4afb commit 7cfde7f

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

cstruct-unix.opam

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ depends: [
1818
"ocaml" {>= "4.06.0"}
1919
"dune" {>= "2.0.0"}
2020
"base-unix"
21-
"mmap" {>= "1.2.0"}
2221
"cstruct" {=version}
2322
]
2423
synopsis: "Access C-like structures directly from OCaml"

unix/dune

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
(name cstruct_unix)
33
(wrapped false)
44
(public_name cstruct-unix)
5-
(libraries cstruct mmap unix))
5+
(libraries cstruct unix))

unix/unix_cstruct.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
*)
1616

1717
let of_fd fd =
18-
let buffer = Bigarray.(array1_of_genarray (Mmap.V1.map_file fd char c_layout false [|-1|])) in
18+
let buffer = Bigarray.(array1_of_genarray (Unix.map_file fd char c_layout false [|-1|])) in
1919
Cstruct.of_bigarray buffer

0 commit comments

Comments
 (0)