Skip to content

SharedArray not type stable #17101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mauro3 opened this issue Jun 25, 2016 · 1 comment
Closed

SharedArray not type stable #17101

mauro3 opened this issue Jun 25, 2016 · 1 comment
Labels
parallelism Parallel or distributed computation

Comments

@mauro3
Copy link
Contributor

mauro3 commented Jun 25, 2016

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...)

timholy added a commit that referenced this issue Jun 25, 2016
Make the SharedArray constructor inferrable. Fixes #17101
@timholy
Copy link
Member

timholy commented Jun 25, 2016

Somehow not autoclosed.

@kshyatt kshyatt added the parallelism Parallel or distributed computation label Jun 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parallelism Parallel or distributed computation
Projects
None yet
Development

No branches or pull requests

3 participants