Skip to content

Commit

Permalink
Merge pull request #299 from hannesm/no-mmap
Browse files Browse the repository at this point in the history
since cstruct-unix requires 4.08+, no need for mmap -- use Unix.map_file directly
  • Loading branch information
hannesm authored Apr 1, 2022
2 parents 407f1c1 + 2bb4afb commit 7cfde7f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion cstruct-unix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ depends: [
"ocaml" {>= "4.06.0"}
"dune" {>= "2.0.0"}
"base-unix"
"mmap" {>= "1.2.0"}
"cstruct" {=version}
]
synopsis: "Access C-like structures directly from OCaml"
Expand Down
2 changes: 1 addition & 1 deletion unix/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
(name cstruct_unix)
(wrapped false)
(public_name cstruct-unix)
(libraries cstruct mmap unix))
(libraries cstruct unix))
2 changes: 1 addition & 1 deletion unix/unix_cstruct.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
*)

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

0 comments on commit 7cfde7f

Please sign in to comment.