Skip to content

Conversation

@avsm
Copy link
Collaborator

@avsm avsm commented Jan 17, 2026

this is a noop in OCaml, but fixes the build in OxCaml (which infers stack allocation locality without an explicit annotation in the case of partial application)

this is a noop in OCaml, but fixes the build in OxCaml
(which infers stack allocation locality without an explicit
annotation in the case of partial application)
Comment on lines +1552 to 1553
let do_recv fd buf pos len fl = if Sys.win32 then Unix.recv fd buf pos len fl else stub_recv fd buf pos len fl in
wrap_syscall Read ch (fun () -> do_recv ch.fd buf pos len flags)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're eta-expanding i think we should also inline, very little point in defining the intermediary identifier

    wrap_syscall Read ch (fun () -> if Sys.win32 then Unix.recv ch.fd buf pos len flags else stub_recv ch.fd buf pos len flags)

or maybe even better

else if Sys.win32 then
  wrap_syscall Read ch (fun () -> Unix.recv ch.fd buf pos len flags)
else
  wrap_syscall Read ch (fun () -> stubs_recv ch.fd buf pos len flags)

because it becomes very readable, easy to scan the two lines and spot the difference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants