Commits

Markus Mottl committed 8635a2f

Safe patch to prepare for larger OCaml 4.0 I/O buffer size

Comments (0)

Files changed (3)

base/core/lib/bigstring_stubs.c

 
 typedef off_t file_offset;
 
-#define IO_BUFFER_SIZE 4096
+#define IO_BUFFER_SIZE 65536
 
 struct channel {
   int fd;                       /* Unix file descriptor */

base/core/lib/in_channel.ml

 let set_binary_mode = Pervasives.set_binary_mode_in
 
 let input_all t =
-  (* We use 4096 because that is the size of OCaml's IO buffers. *)
-  let buf_size = 4096 in
+  (* We use 65536 because that is the size of OCaml's IO buffers. *)
+  let buf_size = 65536 in
   let buf = String.create buf_size in
   let buffer = Buffer.create buf_size in
   let rec loop () =

base/core/lib/misc.c

 /* Fix the broken close_(in/out) function which does not release the
    caml lock. */
 
-#define IO_BUFFER_SIZE 4096
+#define IO_BUFFER_SIZE 65536
 
 typedef long file_offset;