Closed
Description
SharedArray constructor is not type stable. On 0.5:
julia> @code_warntype SharedArray(Int, 1)
Variables:
#self#::Type{SharedArray}
T::Type{Int64}
I::Tuple{Int64}
Body:
begin # sharedarray.jl, line 114:
return $(Expr(:invoke, #SharedArray#457(::Array{Any,1}, ::Type{T}, ::Type{T}, ::Int64, ::Vararg{Int64,N}), :(Base.#SharedArray#457), :((Core.ccall)(:jl_alloc_array_1d,(Core.apply_type)(Core.Array,Any,1)::Type{Array{Any,1}},(Core.svec)(Core.Any,Core.Int)::SimpleVector,Array{Any,1},0,0,0)::Array{Any,1}), :(#self#), :(T), :((Core.getfield)(I,1)::Int64)))
end::Union{SharedArray{T,N},Void}
On 0.4, the inferred type is Any
. I'm pretty sure Any
was also inferred for 0.5 until recently, maybe #17095 changed this?
(I could have sworn I filed this two days ago, but apparently not...)