Skip to content

Commit

Permalink
fix a forgotten rename readuntil -> copyuntil (#56380)
Browse files Browse the repository at this point in the history
Fixes #56352, with the repro in
that issue:

```
Master:
  1.114874 seconds (13.01 M allocations: 539.592 MiB, 3.80% gc time)

After:
   0.369492 seconds (12.99 M allocations: 485.031 MiB, 10.73% gc time)

1.10:
    0.341114 seconds (8.36 M allocations: 454.242 MiB, 2.69% gc time)
```

(cherry picked from commit 07530bc)
  • Loading branch information
KristofferC committed Nov 11, 2024
1 parent a25475c commit fac5efc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/stream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ function readavailable(this::LibuvStream)
return bytes
end

function readuntil(x::LibuvStream, c::UInt8; keep::Bool=false)
function copyuntil(out::IO, x::LibuvStream, c::UInt8; keep::Bool=false)
iolock_begin()
buf = x.buffer
@assert buf.seekable == false
Expand Down Expand Up @@ -1057,9 +1057,9 @@ function readuntil(x::LibuvStream, c::UInt8; keep::Bool=false)
end
end
end
bytes = readuntil(buf, c, keep=keep)
copyuntil(out, buf, c; keep)
iolock_end()
return bytes
return out
end

uv_write(s::LibuvStream, p::Vector{UInt8}) = GC.@preserve p uv_write(s, pointer(p), UInt(sizeof(p)))
Expand Down

0 comments on commit fac5efc

Please sign in to comment.