ocaml-multicore / eio

Effects-based direct-style IO for multicore OCaml
Other
529 stars 67 forks source link

Fix handling of very long IO vectors #653

Closed talex5 closed 7 months ago

talex5 commented 7 months ago

Flow.write doesn't place any limit on how long the list of vectors can be, but real operating systems do have limits and will fail if given too many.

Also, Eio_posix was allocating the array on the stack, which could fail if it was very large.

This is a partial fix for #633, which prevents it from crashing, but we should still get Buf_write to flush when the list of buffers gets long, for efficiency.