Skip to content

Commit

Permalink
Add a pin-depends to dscheck + formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrm committed Jul 4, 2024
1 parent 1ad36b1 commit d9fa5c7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
(>= 4.12.0))
;; Test dependencies
(multicore-magic
(= :version))))
(>= 2.2.0))))
7 changes: 6 additions & 1 deletion multicore-magic-dscheck.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bug-reports: "https://github.com/ocaml-multicore/multicore-magic/issues"
depends: [
"dune" {>= "3.14"}
"ocaml" {>= "4.12.0"}
"multicore-magic" {= version}
"multicore-magic" {>= "2.2.0"}
"odoc" {with-doc}
]
build: [
Expand All @@ -27,3 +27,8 @@ build: [
]
]
dev-repo: "git+https://github.com/ocaml-multicore/multicore-magic.git"
pin-depends:
[
"dscheck.~dev"
"git+https://github.com/lyrm/dscheck.git#make_contended"
]
5 changes: 5 additions & 0 deletions multicore-magic-dscheck.opam.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pin-depends:
[
"dscheck.~dev"
"git+https://github.com/lyrm/dscheck.git#make_contended"
]
1 change: 0 additions & 1 deletion src/dscheck/multicore_magic_atomic_array_dscheck.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ let[@inline] unsafe_fenceless_get xs i = !(Obj.magic (at xs i))

let[@inline] unsafe_compare_and_set xs i b a =
Atomic.compare_and_set (at xs i) b a

2 changes: 0 additions & 2 deletions src/dscheck/multicore_magic_dscheck.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include Multicore_magic


let[@inline] fenceless_get (atomic : 'a Atomic.t) =
!(Sys.opaque_identity (Obj.magic atomic : 'a ref))

Expand All @@ -9,6 +8,5 @@ let[@inline] fenceless_set (atomic : 'a Atomic.t) value =

let[@inline] fence atomic = Atomic.fetch_and_add atomic 0 |> ignore


module Transparent_atomic = Transparent_atomic_dscheck
module Atomic_array = Multicore_magic_atomic_array_dscheck
3 changes: 2 additions & 1 deletion src/dscheck/transparent_atomic_dscheck.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include Dscheck.TracedAtomic

let fenceless_get = get
let fenceless_set = set
let fenceless_set = set

0 comments on commit d9fa5c7

Please sign in to comment.