Skip to content

Commit

Permalink
Avoid triggering Gc.counters memory unsafety on 5.2 and earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
jmid committed Sep 9, 2024
1 parent 35d9e9d commit e9c9a6a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gc/stm_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ struct
let index_gen = Gen.int_bound (array_length-1) in
QCheck.make ~print:show_cmd
Gen.(frequency
(let gens =
[ 1, return Stat;
1, return Quick_stat;
1, return Counters; (* known problem with Counters on <= 5.2: https://github.com/ocaml/ocaml/pull/13370 *)
1, return Minor_words;
1, return Get;
1, return Minor;
Expand All @@ -77,7 +77,10 @@ struct
5, map3 (fun src1 src2 tgt -> CatStr (src1,src2,tgt)) index_gen index_gen index_gen;
10, map2 (fun index len -> AllocList (index,len)) index_gen Gen.nat;
10, map (fun index -> RevList index) index_gen;
])
] in
if Sys.(ocaml_release.major,ocaml_release.minor) > (5,3)
then (1, return Counters)::gens (* known problem with Counters on <= 5.2: https://github.com/ocaml/ocaml/pull/13370 *)
else gens))

let next_state n _s = match n with
| Stat -> ()
Expand Down

0 comments on commit e9c9a6a

Please sign in to comment.