Skip to content

Commit 8dd68da

Browse files
committed
merge in
2 parents 091ffc1 + f1b00f8 commit 8dd68da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1432
-272
lines changed

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
[submodule "deps/Rmath"]
1111
path = deps/Rmath
1212
url = git://github.com/JuliaLang/Rmath.git
13-
[submodule "doc/juliadoc"]
14-
path = doc/juliadoc
15-
url = git://github.com/JuliaLang/JuliaDoc.git
16-
1713
[submodule "deps/libmojibake"]
1814
path = deps/libmojibake
1915
url = git://github.com/JuliaLang/libmojibake.git

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ endif
268268
-gtk-update-icon-cache $(DESTDIR)$(datarootdir)/icons/hicolor/
269269
mkdir -p $(DESTDIR)$(datarootdir)/applications/
270270
$(INSTALL_F) contrib/julia.desktop $(DESTDIR)$(datarootdir)/applications/
271+
# Install appdata file
272+
mkdir -p $(DESTDIR)$(datarootdir)/appdata/
273+
$(INSTALL_F) contrib/julia.appdata.xml $(DESTDIR)$(datarootdir)/appdata/
271274

272275
# Update RPATH entries and JL_SYSTEM_IMAGE_PATH if $(private_libdir_rel) != $(build_private_libdir_rel)
273276
ifneq ($(private_libdir_rel),$(build_private_libdir_rel))

NEWS.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ Library improvements
6868

6969
* `deepcopy` recurses through immutable types and makes copies of their mutable fields ([#8560]).
7070

71+
Deprecated or removed
72+
---------------------
73+
74+
* `median` and `median!` no longer accept a `checknan` keyword argument ([#8605]).
75+
7176
Julia v0.3.0 Release Notes
7277
==========================
7378

@@ -852,6 +857,7 @@ Too numerous to mention.
852857
[#3688]: https://github.com/JuliaLang/julia/issues/3688
853858
[#3697]: https://github.com/JuliaLang/julia/issues/3697
854859
[#3719]: https://github.com/JuliaLang/julia/issues/3719
860+
[#3759]: https://github.com/JuliaLang/julia/issues/3759
855861
[#3790]: https://github.com/JuliaLang/julia/issues/3790
856862
[#3819]: https://github.com/JuliaLang/julia/issues/3819
857863
[#3872]: https://github.com/JuliaLang/julia/issues/3872
@@ -913,6 +919,7 @@ Too numerous to mention.
913919
[#5381]: https://github.com/JuliaLang/julia/issues/5381
914920
[#5387]: https://github.com/JuliaLang/julia/issues/5387
915921
[#5403]: https://github.com/JuliaLang/julia/issues/5403
922+
[#5413]: https://github.com/JuliaLang/julia/issues/5413
916923
[#5423]: https://github.com/JuliaLang/julia/issues/5423
917924
[#5427]: https://github.com/JuliaLang/julia/issues/5427
918925
[#5428]: https://github.com/JuliaLang/julia/issues/5428
@@ -962,6 +969,7 @@ Too numerous to mention.
962969
[#6678]: https://github.com/JuliaLang/julia/issues/6678
963970
[#6716]: https://github.com/JuliaLang/julia/issues/6716
964971
[#6726]: https://github.com/JuliaLang/julia/issues/6726
972+
[#6739]: https://github.com/JuliaLang/julia/issues/6739
965973
[#6769]: https://github.com/JuliaLang/julia/issues/6769
966974
[#6773]: https://github.com/JuliaLang/julia/issues/6773
967975
[#6911]: https://github.com/JuliaLang/julia/issues/6911
@@ -981,6 +989,7 @@ Too numerous to mention.
981989
[#7146]: https://github.com/JuliaLang/julia/issues/7146
982990
[#7236]: https://github.com/JuliaLang/julia/issues/7236
983991
[#7242]: https://github.com/JuliaLang/julia/issues/7242
992+
[#7311]: https://github.com/JuliaLang/julia/issues/7311
984993
[#7359]: https://github.com/JuliaLang/julia/issues/7359
985994
[#7365]: https://github.com/JuliaLang/julia/issues/7365
986995
[#7373]: https://github.com/JuliaLang/julia/issues/7373
@@ -990,14 +999,12 @@ Too numerous to mention.
990999
[#7513]: https://github.com/JuliaLang/julia/issues/7513
9911000
[#7647]: https://github.com/JuliaLang/julia/issues/7647
9921001
[#7654]: https://github.com/JuliaLang/julia/issues/7654
1002+
[#7704]: https://github.com/JuliaLang/julia/issues/7704
9931003
[#7917]: https://github.com/JuliaLang/julia/issues/7917
9941004
[#7992]: https://github.com/JuliaLang/julia/issues/7992
9951005
[#8011]: https://github.com/JuliaLang/julia/issues/8011
9961006
[#8089]: https://github.com/JuliaLang/julia/issues/8089
997-
[#7704]: https://github.com/JuliaLang/julia/issues/7704
998-
[#5413]: https://github.com/JuliaLang/julia/issues/5413
999-
[#3759]: https://github.com/JuliaLang/julia/issues/3759
1000-
[#7311]: https://github.com/JuliaLang/julia/issues/7311
1007+
[#8152]: https://github.com/JuliaLang/julia/issues/8152
10011008
[#8423]: https://github.com/JuliaLang/julia/issues/8423
1002-
[#8152]: https://github.com/JuliaLang/julia/pull/8152
1003-
[#6739]: https://github.com/JuliaLang/julia/issues/6739
1009+
[#8560]: https://github.com/JuliaLang/julia/issues/8560
1010+
[#8605]: https://github.com/JuliaLang/julia/issues/8605

base/array.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ indmin(a) = findmin(a)[2]
11481148
# similar to Matlab's ismember
11491149
# returns a vector containing the highest index in b for each value in a that is a member of b
11501150
function indexin(a::AbstractArray, b::AbstractArray)
1151-
bdict = Dict(b, 1:length(b))
1151+
bdict = Dict(zip(b, 1:length(b)))
11521152
[get(bdict, i, 0) for i in a]
11531153
end
11541154

base/deprecated.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,13 @@ const Nothing = Void
185185

186186
export None
187187
const None = Union()
188+
189+
@deprecate median(v::AbstractArray; checknan::Bool=true) median(v)
190+
@deprecate median(v::AbstractArray, region; checknan::Bool=true) median(v, region)
191+
@deprecate median!(v::AbstractVector; checknan::Bool=true) median!(v)
192+
193+
@deprecate Dict{K,V}(ks::AbstractArray{K}, vs::AbstractArray{V}) Dict{K,V}(zip(ks, vs))
194+
@deprecate Dict{K,V}(ks::(K...), vs::(V...)) Dict{K,V}(zip(ks, vs))
195+
@deprecate Dict{K}(ks::(K...), vs::Tuple) Dict{K,Any}(zip(ks, vs))
196+
@deprecate Dict{V}(ks::Tuple, vs::(V...)) Dict{Any,V}(zip(ks, vs))
197+
@deprecate Dict(ks, vs) Dict{Any,Any}(zip(ks, vs))

base/dict.jl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -341,18 +341,22 @@ Dict(kv::()) = Dict()
341341
const AnyDict = Dict{Any,Any}
342342

343343
# TODO: this can probably be simplified using `eltype` as a THT (Tim Holy trait)
344-
Dict{K,V}(kv::((K,V)...,)) = Dict{K,V}(kv)
345-
Dict{K }(kv::((K,Any)...,)) = Dict{K,Any}(kv)
346-
Dict{V }(kv::((Any,V)...,)) = Dict{Any,V}(kv)
347-
Dict{K,V}(kv::(Pair{K,V}...,)) = Dict{K,V}(kv)
348-
Dict (kv::(Pair...,)) = Dict{Any,Any}(kv)
344+
Dict{K,V}(kv::((K,V)...,)) = Dict{K,V}(kv)
345+
Dict{K }(kv::((K,Any)...,)) = Dict{K,Any}(kv)
346+
Dict{V }(kv::((Any,V)...,)) = Dict{Any,V}(kv)
347+
Dict{K,V}(kv::(Pair{K,V}...,)) = Dict{K,V}(kv)
348+
Dict{K} (kv::(Pair{K}...,)) = Dict{K,Any}(kv)
349+
Dict{V} (kv::(Pair{TypeVar(:K),V}...,)) = Dict{Any,V}(kv)
350+
Dict (kv::(Pair...,)) = Dict{Any,Any}(kv)
349351

350352
Dict{K,V}(kv::AbstractArray{(K,V)}) = Dict{K,V}(kv)
351353
Dict{K,V}(kv::AbstractArray{Pair{K,V}}) = Dict{K,V}(kv)
352354
Dict{K,V}(kv::Associative{K,V}) = Dict{K,V}(kv)
353355

354-
Dict{K,V}(ps::Pair{K,V}...) = Dict{K,V}(ps)
355-
Dict (ps::Pair...) = Dict{Any,Any}(ps)
356+
Dict{K,V}(ps::Pair{K,V}...) = Dict{K,V}(ps)
357+
Dict{K} (ps::Pair{K}...,) = Dict{K,Any}(ps)
358+
Dict{V} (ps::Pair{TypeVar(:K),V}...,) = Dict{Any,V}(ps)
359+
Dict (ps::Pair...) = Dict{Any,Any}(ps)
356360

357361
Dict(kv) = dict_with_eltype(kv, eltype(kv))
358362
dict_with_eltype{K,V}(kv, ::Type{(K,V)}) = Dict{K,V}(kv)
@@ -468,8 +472,10 @@ end
468472
function empty!{K,V}(h::Dict{K,V})
469473
fill!(h.slots, 0x0)
470474
sz = length(h.slots)
471-
h.keys = Array(K, sz)
472-
h.vals = Array(V, sz)
475+
empty!(h.keys)
476+
empty!(h.vals)
477+
resize!(h.keys, sz)
478+
resize!(h.vals, sz)
473479
h.ndel = 0
474480
h.count = 0
475481
return h

base/intfuncs.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,26 @@ function gcd{T<:Integer}(a::T, b::T)
99
abs(a)
1010
end
1111

12+
# binary GCD (aka Stein's) algorithm
13+
# about 1.7x (2.1x) faster for random Int64s (Int128s)
14+
function gcd{T<:Union(Int64,Uint64,Int128,Uint128)}(a::T, b::T)
15+
a == 0 && return abs(b)
16+
b == 0 && return abs(a)
17+
za = trailing_zeros(a)
18+
zb = trailing_zeros(b)
19+
k = min(za, zb)
20+
u = abs(a >> za)
21+
v = abs(b >> zb)
22+
while u != v
23+
if u > v
24+
u, v = v, u
25+
end
26+
v -= u
27+
v >>= trailing_zeros(v)
28+
end
29+
u << k
30+
end
31+
1232
# explicit a==0 test is to handle case of lcm(0,0) correctly
1333
lcm{T<:Integer}(a::T, b::T) = a == 0 ? a : abs(a * div(b, gcd(b,a)))
1434

base/linalg.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,21 @@ end
162162
#Check that stride of matrix/vector is 1
163163
function chkstride1(A::StridedVecOrMat...)
164164
for a in A
165-
stride(a,1)== 1 || error("Matrix does not have contiguous columns")
165+
stride(a,1)== 1 || error("matrix does not have contiguous columns")
166166
end
167167
end
168168

169169
#Check that matrix is square
170170
function chksquare(A::AbstractMatrix)
171171
m,n = size(A)
172-
m == n || throw(DimensionMismatch("Matrix is not square"))
172+
m == n || throw(DimensionMismatch("matrix is not square"))
173173
m
174174
end
175175

176176
function chksquare(A...)
177-
sizes=Int[]
177+
sizes = Int[]
178178
for a in A
179-
size(a,1)==size(a,2) || throw(DimensionMismatch("Matrix is not square: dimensions are $(size(a))"))
179+
size(a,1)==size(a,2) || throw(DimensionMismatch("matrix is not square: dimensions are $(size(a))"))
180180
push!(sizes, size(a,1))
181181
end
182182
length(A)==1 ? sizes[1] : sizes

base/linalg/factorization.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ end
2121
# Note. For QRCompactWY factorization without pivoting, the WY representation based method introduced in LAPACK 3.4
2222
immutable QRCompactWY{S} <: Factorization{S}
2323
factors::Matrix{S}
24-
T::Triangular{S}
24+
T::Matrix{S}
2525
end
26-
QRCompactWY{S}(factors::Matrix{S}, T::Matrix{S})=QRCompactWY{S}(factors, Triangular(T, :U))
26+
QRCompactWY{S}(factors::Matrix{S}, T::Matrix{S})=QRCompactWY{S}(factors, T)
2727

2828
immutable QRPivoted{T} <: Factorization{T}
2929
factors::Matrix{T}
@@ -113,7 +113,7 @@ immutable QRPackedQ{T} <: AbstractMatrix{T}
113113
end
114114
immutable QRCompactWYQ{S} <: AbstractMatrix{S}
115115
factors::Matrix{S}
116-
T::Triangular{S}
116+
T::Matrix{S}
117117
end
118118

119119
convert{T}(::Type{QRPackedQ{T}}, Q::QRPackedQ) = QRPackedQ(convert(AbstractMatrix{T}, Q.factors), convert(Vector{T}, Q.τ))
@@ -130,7 +130,7 @@ full{T}(A::Union(QRPackedQ{T},QRCompactWYQ{T}); thin::Bool=true) = A_mul_B!(A, t
130130

131131
## Multiplication by Q
132132
### QB
133-
A_mul_B!{T<:BlasFloat}(A::QRCompactWYQ{T}, B::StridedVecOrMat{T}) = LAPACK.gemqrt!('L','N',A.factors,A.T.data,B)
133+
A_mul_B!{T<:BlasFloat}(A::QRCompactWYQ{T}, B::StridedVecOrMat{T}) = LAPACK.gemqrt!('L','N',A.factors,A.T,B)
134134
A_mul_B!{T<:BlasFloat}(A::QRPackedQ{T}, B::StridedVecOrMat{T}) = LAPACK.ormqr!('L','N',A.factors,A.τ,B)
135135
function A_mul_B!{T}(A::QRPackedQ{T}, B::AbstractVecOrMat{T})
136136
mA, nA = size(A.factors)
@@ -167,8 +167,8 @@ function *{TA,TB}(A::Union(QRPackedQ{TA},QRCompactWYQ{TA}), B::StridedMatrix{TB}
167167
A_mul_B!(Anew,Bnew)
168168
end
169169
### QcB
170-
Ac_mul_B!{T<:BlasReal}(A::QRCompactWYQ{T}, B::StridedVecOrMat{T}) = LAPACK.gemqrt!('L','T',A.factors,A.T.data,B)
171-
Ac_mul_B!{T<:BlasComplex}(A::QRCompactWYQ{T}, B::StridedVecOrMat{T}) = LAPACK.gemqrt!('L','C',A.factors,A.T.data,B)
170+
Ac_mul_B!{T<:BlasReal}(A::QRCompactWYQ{T}, B::StridedVecOrMat{T}) = LAPACK.gemqrt!('L','T',A.factors,A.T,B)
171+
Ac_mul_B!{T<:BlasComplex}(A::QRCompactWYQ{T}, B::StridedVecOrMat{T}) = LAPACK.gemqrt!('L','C',A.factors,A.T,B)
172172
Ac_mul_B!{T<:BlasReal}(A::QRPackedQ{T}, B::StridedVecOrMat{T}) = LAPACK.ormqr!('L','T',A.factors,A.τ,B)
173173
Ac_mul_B!{T<:BlasComplex}(A::QRPackedQ{T}, B::StridedVecOrMat{T}) = LAPACK.ormqr!('L','C',A.factors,A.τ,B)
174174
function Ac_mul_B!{T}(A::QRPackedQ{T}, B::AbstractVecOrMat{T})
@@ -198,7 +198,7 @@ function Ac_mul_B{TQ<:Number,TB<:Number,N}(Q::Union(QRPackedQ{TQ},QRCompactWYQ{T
198198
Ac_mul_B!(convert(AbstractMatrix{TQB}, Q), TB == TQB ? copy(B) : convert(AbstractArray{TQB,N}, B))
199199
end
200200
### AQ
201-
A_mul_B!{T<:BlasFloat}(A::StridedVecOrMat{T}, B::QRCompactWYQ{T}) = LAPACK.gemqrt!('R','N', B.factors, B.T.data, A)
201+
A_mul_B!{T<:BlasFloat}(A::StridedVecOrMat{T}, B::QRCompactWYQ{T}) = LAPACK.gemqrt!('R','N', B.factors, B.T, A)
202202
A_mul_B!(A::StridedVecOrMat, B::QRPackedQ) = LAPACK.ormqr!('R', 'N', B.factors, B.τ, A)
203203
function A_mul_B!{T}(A::StridedMatrix{T},Q::QRPackedQ{T})
204204
mQ, nQ = size(Q.factors)
@@ -227,8 +227,8 @@ function *{TA,TQ,N}(A::StridedArray{TA,N}, Q::Union(QRPackedQ{TQ},QRCompactWYQ{T
227227
A_mul_B!(TA==TAQ ? copy(A) : convert(AbstractArray{TAQ,N}, A), convert(AbstractMatrix{TAQ}, Q))
228228
end
229229
### AQc
230-
A_mul_Bc!{T<:BlasReal}(A::StridedVecOrMat{T}, B::QRCompactWYQ{T}) = LAPACK.gemqrt!('R','T',B.factors,B.T.data,A)
231-
A_mul_Bc!{T<:BlasComplex}(A::StridedVecOrMat{T}, B::QRCompactWYQ{T}) = LAPACK.gemqrt!('R','C',B.factors,B.T.data,A)
230+
A_mul_Bc!{T<:BlasReal}(A::StridedVecOrMat{T}, B::QRCompactWYQ{T}) = LAPACK.gemqrt!('R','T',B.factors,B.T,A)
231+
A_mul_Bc!{T<:BlasComplex}(A::StridedVecOrMat{T}, B::QRCompactWYQ{T}) = LAPACK.gemqrt!('R','C',B.factors,B.T,A)
232232
A_mul_Bc!{T<:BlasReal}(A::StridedVecOrMat{T}, B::QRPackedQ{T}) = LAPACK.ormqr!('R','T',B.factors,B.τ,A)
233233
A_mul_Bc!{T<:BlasComplex}(A::StridedVecOrMat{T}, B::QRPackedQ{T}) = LAPACK.ormqr!('R','C',B.factors,B.τ,A)
234234
function A_mul_Bc!{T}(A::AbstractMatrix{T},Q::QRPackedQ{T})

base/linalg/matmul.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ arithtype(T) = T
44
arithtype(::Type{Bool}) = Int
55

66
# multiply by diagonal matrix as vector
7-
function scale!(C::Matrix, A::Matrix, b::Vector)
7+
function scale!(C::AbstractMatrix, A::AbstractMatrix, b::AbstractVector)
88
m, n = size(A)
9-
n==length(b) || throw(DimensionMismatch(""))
9+
n == length(b) || throw(DimensionMismatch(""))
1010
for j = 1:n
1111
bj = b[j]
1212
for i = 1:m
@@ -16,10 +16,10 @@ function scale!(C::Matrix, A::Matrix, b::Vector)
1616
C
1717
end
1818

19-
function scale!(C::Matrix, b::Vector, A::Matrix)
19+
function scale!(C::AbstractMatrix, b::AbstractVector, A::AbstractMatrix)
2020
m, n = size(A)
21-
m==length(b) || throw(DimensionMismatch(""))
22-
for j=1:n, i=1:m
21+
m == length(b) || throw(DimensionMismatch(""))
22+
for j = 1:n, i = 1:m
2323
C[i,j] = A[i,j]*b[i]
2424
end
2525
C
@@ -29,8 +29,8 @@ scale(b::Vector, A::Matrix) = scale!(similar(b, promote_type(eltype(A),eltype(b)
2929

3030
# Dot products
3131

32-
dot{T<:BlasReal}(x::Vector{T}, y::Vector{T}) = BLAS.dot(x, y)
33-
dot{T<:BlasComplex}(x::Vector{T}, y::Vector{T}) = BLAS.dotc(x, y)
32+
dot{T<:BlasReal}(x::StridedVector{T}, y::StridedVector{T}) = BLAS.dot(x, y)
33+
dot{T<:BlasComplex}(x::StridedVector{T}, y::StridedVector{T}) = BLAS.dotc(x, y)
3434
function dot{T<:BlasReal, TI<:Integer}(x::Vector{T}, rx::Union(UnitRange{TI},Range{TI}), y::Vector{T}, ry::Union(UnitRange{TI},Range{TI}))
3535
length(rx)==length(ry) || throw(DimensionMismatch(""))
3636
if minimum(rx) < 1 || maximum(rx) > length(x) || minimum(ry) < 1 || maximum(ry) > length(y)
@@ -58,9 +58,9 @@ function dot(x::AbstractVector, y::AbstractVector)
5858
s
5959
end
6060
dot(x::Number, y::Number) = conj(x) * y
61-
Ac_mul_B(x::Vector, y::Vector) = [dot(x, y)]
62-
At_mul_B{T<:Real}(x::Vector{T}, y::Vector{T}) = [dot(x, y)]
63-
At_mul_B{T<:BlasComplex}(x::Vector{T}, y::Vector{T}) = [BLAS.dotu(x, y)]
61+
Ac_mul_B(x::AbstractVector, y::AbstractVector) = [dot(x, y)]
62+
At_mul_B{T<:Real}(x::AbstractVector{T}, y::AbstractVector{T}) = [dot(x, y)]
63+
At_mul_B{T<:BlasComplex}(x::StridedVector{T}, y::StridedVector{T}) = [BLAS.dotu(x, y)]
6464

6565
# Matrix-vector multiplication
6666
function (*){T<:BlasFloat,S}(A::StridedMatrix{T}, x::StridedVector{S})

base/linalg/triangular.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ immutable Triangular{T,S<:AbstractMatrix{T},UpLo,IsUnit} <: AbstractMatrix{T}
33
data::S
44
end
55
function Triangular{T}(A::AbstractMatrix{T}, uplo::Symbol, isunit::Bool=false)
6+
chksquare(A)
67
uplo != :L && uplo != :U && throw(ArgumentError("uplo argument must be either :U or :L"))
78
return Triangular{T,typeof(A),uplo,isunit}(A)
89
end
@@ -144,7 +145,7 @@ fill!(A::Triangular, x) = (fill!(A.data, x); A)
144145

145146
function similar{T,S,UpLo,IsUnit,Tnew}(A::Triangular{T,S,UpLo,IsUnit}, ::Type{Tnew}, dims::Dims)
146147
dims[1] == dims[2] || throw(ArgumentError("a Triangular matrix must be square"))
147-
length(dims) == 2 || throw(ArgumentError("a Traigular matrix must have two dimensions"))
148+
length(dims) == 2 || throw(ArgumentError("a Triangular matrix must have two dimensions"))
148149
A = similar(A.data, Tnew, dims)
149150
return Triangular{Tnew, typeof(A), UpLo, IsUnit}(A)
150151
end

base/multi.jl

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ function accept_handler(server::TCPServer, status::Int32)
797797
end
798798

799799
function create_message_handler_loop(sock::AsyncStream; ntfy_join_complete=nothing) #returns immediately
800-
schedule(@task begin
800+
@schedule begin
801801
global PGRP
802802
#println("message_handler_loop")
803803
disable_nagle(sock)
@@ -823,26 +823,32 @@ function create_message_handler_loop(sock::AsyncStream; ntfy_join_complete=nothi
823823
id = deserialize(sock)
824824
f = deserialize(sock)
825825
args = deserialize(sock)
826-
@schedule begin
827-
v = run_work_thunk(()->f(args...))
828-
deliver_result(sock, msg, id, v)
829-
v
826+
let f=f, args=args, id=id, msg=msg
827+
@schedule begin
828+
v = run_work_thunk(()->f(args...))
829+
deliver_result(sock, msg, id, v)
830+
v
831+
end
830832
end
831833
elseif is(msg, :call_wait)
832834
id = deserialize(sock)
833835
notify_id = deserialize(sock)
834836
f = deserialize(sock)
835837
args = deserialize(sock)
836-
@schedule begin
837-
rv = schedule_call(id, ()->f(args...))
838-
deliver_result(sock, msg, notify_id, wait_full(rv))
838+
let f=f, args=args, id=id, msg=msg, notify_id=notify_id
839+
@schedule begin
840+
rv = schedule_call(id, ()->f(args...))
841+
deliver_result(sock, msg, notify_id, wait_full(rv))
842+
end
839843
end
840844
elseif is(msg, :do)
841845
f = deserialize(sock)
842846
args = deserialize(sock)
843847
#print("got args: $args\n")
844-
@schedule begin
845-
run_work_thunk(RemoteValue(), ()->f(args...))
848+
let f=f, args=args
849+
@schedule begin
850+
run_work_thunk(RemoteValue(), ()->f(args...))
851+
end
846852
end
847853
elseif is(msg, :result)
848854
# used to deliver result of wait or fetch
@@ -924,7 +930,7 @@ function create_message_handler_loop(sock::AsyncStream; ntfy_join_complete=nothi
924930

925931
return nothing
926932
end
927-
end)
933+
end
928934
end
929935

930936
function disable_threaded_libs()

base/profile.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ end
6363

6464
function getdict(data::Vector{Uint})
6565
uip = unique(data)
66-
Dict(uip, [lookup(ip) for ip in uip])
66+
Dict{Uint, LineInfo}([ip=>lookup(ip) for ip in uip])
6767
end
6868

6969
function callers(funcname::ByteString, bt::Vector{Uint}, lidict; filename = nothing, linerange = nothing)

0 commit comments

Comments
 (0)