Skip to content

Commit

Permalink
Flush before reading out from a file
Browse files Browse the repository at this point in the history
  • Loading branch information
lukstafi committed Feb 18, 2024
1 parent 880bdf2 commit df7e8f9
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions minidebug_runtime.ml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ let debug_ch ?(time_tagged = false) ?(elapsed_times = elapsed_default)
current_snapshot := 0);
!current_ch

let snapshot_ch () = current_snapshot := pos_out !current_ch
let snapshot_ch () =
flush !current_ch;
current_snapshot := pos_out !current_ch

let reset_to_snapshot () = seek_out !current_ch !current_snapshot
let time_tagged = time_tagged
let elapsed_times = elapsed_times
Expand Down Expand Up @@ -810,7 +813,11 @@ let debug ?debug_ch ?(time_tagged = false) ?(elapsed_times = elapsed_default)
let current_snapshot = ref 0

let snapshot_ch () =
match debug_ch with None -> () | Some _ -> current_snapshot := pos_out ch
match debug_ch with
| None -> ()
| Some _ ->
flush ch;
current_snapshot := pos_out ch

let reset_to_snapshot () =
match debug_ch with
Expand Down Expand Up @@ -841,7 +848,11 @@ let debug_flushing ?debug_ch ?(time_tagged = false) ?(elapsed_times = elapsed_de
let current_snapshot = ref 0

let snapshot_ch () =
match debug_ch with None -> () | Some _ -> current_snapshot := pos_out ch
match debug_ch with
| None -> ()
| Some _ ->
flush ch;
current_snapshot := pos_out ch

let reset_to_snapshot () =
match debug_ch with
Expand Down

0 comments on commit df7e8f9

Please sign in to comment.