File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -761,10 +761,17 @@ let get_values tn =
761761let print_accessible_headers ?(pred = fun _ -> true ) () =
762762 Stdio. printf " Tnode: collecting accessible arrays...%!\n " ;
763763 Stdlib.Gc. full_major () ;
764- Registry. iter (fun arr -> if pred arr then Stdio. print_endline @@ header arr) registry;
764+ let results =
765+ Registry. fold (fun arr acc -> if pred arr then (arr.id, header arr) :: acc else acc) registry []
766+ in
767+ List. sort results ~compare: (fun (a , _ ) (b , _ ) -> compare_int a b)
768+ |> List. iter ~f: (fun (_ , header ) -> Stdio. print_endline header);
765769 Stdio. printf " Tnode: Finished printing headers.%!\n "
766770
767771let % debug_sexp log_accessible_headers ?(pred = fun _ -> true ) () =
768772 Stdlib.Gc. full_major () ;
769- Registry. iter (fun arr -> if pred arr then [% log header arr]) registry;
770- ()
773+ let results =
774+ Registry. fold (fun arr acc -> if pred arr then (arr.id, header arr) :: acc else acc) registry []
775+ in
776+ List. sort results ~compare: (fun (a , _ ) (b , _ ) -> compare_int a b)
777+ |> List. iter ~f: (fun (_ , header ) -> [% log header])
You can’t perform that action at this time.
0 commit comments