Skip to content

Commit 6cff73f

Browse files
authored
make methods of alloc_buf_hook return the same types (#39141)
1 parent 83bee67 commit 6cff73f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

base/stream.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ function alloc_request(buffer::IOBuffer, recommended_size::UInt)
554554
ensureroom(buffer, Int(recommended_size))
555555
ptr = buffer.append ? buffer.size + 1 : buffer.ptr
556556
nb = min(length(buffer.data), buffer.maxsize) - ptr + 1
557-
return (pointer(buffer.data, ptr), nb)
557+
return (Ptr{Cvoid}(pointer(buffer.data, ptr)), nb)
558558
end
559559

560560
notify_filled(buffer::IOBuffer, nread::Int, base::Ptr{Cvoid}, len::UInt) = notify_filled(buffer, nread)

stdlib/Sockets/src/Sockets.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ function recvfrom(sock::UDPSocket)
367367
end
368368
end
369369

370-
alloc_buf_hook(sock::UDPSocket, size::UInt) = (Libc.malloc(size), size) # size is always 64k from libuv
370+
alloc_buf_hook(sock::UDPSocket, size::UInt) = (Libc.malloc(size), Int(size)) # size is always 64k from libuv
371371

372372
function uv_recvcb(handle::Ptr{Cvoid}, nread::Cssize_t, buf::Ptr{Cvoid}, addr::Ptr{Cvoid}, flags::Cuint)
373373
sock = @handle_as handle UDPSocket

0 commit comments

Comments
 (0)