Skip to content

Commit

Permalink
prevent fill! from inlining (#26418)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored Mar 14, 2018
1 parent 3086c23 commit ead9eab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ copyto!(dest::Array{T}, src::Array{T}) where {T} = copyto!(dest, 1, src, 1, leng
# N.B: The generic definition in multidimensional.jl covers, this, this is just here
# for bootstrapping purposes.
function fill!(dest::Array{T}, x) where T
@_noinline_meta
xT = convert(T, x)
for i in 1:length(dest)
@inbounds dest[i] = xT
Expand Down Expand Up @@ -318,6 +319,7 @@ function fill!(a::Union{Array{UInt8}, Array{Int8}}, x::Integer)
end

function fill!(a::Array{T}, x) where T<:Union{Integer,AbstractFloat}
@_noinline_meta
xT = convert(T, x)
for i in eachindex(a)
@inbounds a[i] = xT
Expand Down

0 comments on commit ead9eab

Please sign in to comment.