Debian Codegraph @

testsuite/tests/gc-roots/globroots_parallel.ml

raw
1 (* TEST
2 flags += " -w a ";
3 modules = "globrootsprim.c globroots.ml";
4 *)
5
6 open Globroots
7
8 let test_size =
9 try int_of_string (Sys.getenv "OCAML_TEST_SIZE")
10 with Not_found | Failure _ -> 0
11
12 let num_domains =
13 match test_size with
14 | 3 -> 8
15 | 2 -> 4
16 | _ -> print_string "ok\n"; exit 0
17
18 let n = 125
19
20 let _ =
21 let domains = Array.init (num_domains - 1) (fun _ ->
22 Domain.spawn(fun () ->
23 let module TestClassic = Test(Classic) () in
24 let module TestGenerational = Test(Generational) () in
25 TestClassic.test n;
26 TestGenerational.test n)) in
27 young2old (); Gc.full_major ();
28 assert (static2young (1, 1) Gc.full_major == 0x42);
29 TestClassic.test n;
30 TestGenerational.test n;
31 Array.iter Domain.join domains;
32 print_string "ok\n"