-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Free channel buffers on close rather than leaving them to the GC.
- Loading branch information
1 parent
d435a29
commit c454cc7
Showing
4 changed files
with
78 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(* TEST | ||
arguments = "${test_build_directory}/testfile.tmp"; | ||
*) | ||
|
||
(* Test that output to a closed out_channel triggers an exception every | ||
time, not just the first time. *) | ||
|
||
let () = | ||
let oc = open_out_bin Sys.argv.(1) in | ||
close_out oc; | ||
begin match output_byte oc 0 with | ||
| exception Sys_error _ -> () | ||
| () -> assert false | ||
end; | ||
begin match output_byte oc 0 with | ||
| exception Sys_error _ -> () | ||
| () -> assert false | ||
end |