Skip to content

Commit 43389bf

Browse files
authored
Merge branch 'master' into mk/jldoctest
2 parents 60b9a62 + 485560f commit 43389bf

File tree

15 files changed

+466
-204
lines changed

15 files changed

+466
-204
lines changed

base/complex.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ function show(io::IO, z::Complex)
206206
print(io, compact ? "+" : " + ")
207207
show(io, i)
208208
end
209-
if !(isa(i,Integer) && !isa(i,Bool) || isa(i,AbstractFloat) && isfinite(i))
209+
if !(isa(i,Signed) || isa(i,AbstractFloat) && isfinite(i))
210210
print(io, "*")
211211
end
212212
print(io, "im")

base/int.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ ERROR: LoadError: ArgumentError: invalid base 10 digit '.' in "123456789123.4"
642642
[...]
643643
```
644644
"""
645-
macro int128_str(s)
645+
macro int128_str(s::String)
646646
return parse(Int128, s)
647647
end
648648

@@ -662,7 +662,7 @@ ERROR: LoadError: ArgumentError: invalid base 10 digit '-' in "-123456789123"
662662
[...]
663663
```
664664
"""
665-
macro uint128_str(s)
665+
macro uint128_str(s::String)
666666
return parse(UInt128, s)
667667
end
668668

@@ -695,7 +695,7 @@ ERROR: ArgumentError: invalid number format _ for BigInt or BigFloat
695695
depends on the value of the precision at the point when the function is
696696
defined, **not** at the precision at the time when the function is called.
697697
"""
698-
macro big_str(s)
698+
macro big_str(s::String)
699699
message = "invalid number format $s for BigInt or BigFloat"
700700
throw_error = :(throw(ArgumentError($message)))
701701
if '_' in s

base/lock.jl

+10-8
Original file line numberDiff line numberDiff line change
@@ -702,10 +702,6 @@ mutable struct OncePerProcess{T, F} <: Function
702702

703703
function OncePerProcess{T,F}(initializer::F) where {T, F}
704704
once = new{T,F}(nothing, PerStateInitial, true, initializer, ReentrantLock())
705-
ccall(:jl_set_precompile_field_replace, Cvoid, (Any, Any, Any),
706-
once, :value, nothing)
707-
ccall(:jl_set_precompile_field_replace, Cvoid, (Any, Any, Any),
708-
once, :state, PerStateInitial)
709705
return once
710706
end
711707
end
@@ -721,6 +717,10 @@ OncePerProcess(initializer) = OncePerProcess{Base.promote_op(initializer), typeo
721717
try
722718
state = @atomic :monotonic once.state
723719
if state == PerStateInitial
720+
ccall(:jl_set_precompile_field_replace, Cvoid, (Any, Any, Any),
721+
once, :value, nothing)
722+
ccall(:jl_set_precompile_field_replace, Cvoid, (Any, Any, Any),
723+
once, :state, PerStateInitial)
724724
once.value = once.initializer()
725725
elseif state == PerStateErrored
726726
error("OncePerProcess initializer failed previously")
@@ -809,10 +809,6 @@ mutable struct OncePerThread{T, F} <: Function
809809
function OncePerThread{T,F}(initializer::F) where {T, F}
810810
xs, ss = AtomicMemory{T}(), AtomicMemory{UInt8}()
811811
once = new{T,F}(xs, ss, initializer)
812-
ccall(:jl_set_precompile_field_replace, Cvoid, (Any, Any, Any),
813-
once, :xs, xs)
814-
ccall(:jl_set_precompile_field_replace, Cvoid, (Any, Any, Any),
815-
once, :ss, ss)
816812
return once
817813
end
818814
end
@@ -849,6 +845,12 @@ OncePerThread(initializer) = OncePerThread{Base.promote_op(initializer), typeof(
849845
ss = @atomic :monotonic once.ss
850846
xs = @atomic :monotonic once.xs
851847
if tid > length(ss)
848+
if length(ss) == 0 # We are the first to initialize
849+
ccall(:jl_set_precompile_field_replace, Cvoid, (Any, Any, Any),
850+
once, :xs, xs)
851+
ccall(:jl_set_precompile_field_replace, Cvoid, (Any, Any, Any),
852+
once, :ss, ss)
853+
end
852854
@assert len <= length(ss) <= length(newss) "logical constraint violation"
853855
fill_monotonic!(newss, PerStateInitial)
854856
xs = copyto_monotonic!(newxs, xs)

base/strings/io.jl

-4
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ setfield!(typeof(println).name.mt, :max_args, 10, :monotonic)
8484
8585
Call the given function with an I/O stream and the supplied extra arguments.
8686
Everything written to this I/O stream is returned as a string.
87-
`context` can be an [`IOContext`](@ref) whose properties will be used, a `Pair`
88-
specifying a property and its value, or a tuple of `Pair` specifying multiple
89-
properties and their values. `sizehint` suggests the capacity of the buffer (in
90-
bytes).
9187
9288
The optional keyword argument `context` can be set to a `:key=>value` pair, a
9389
tuple of `:key=>value` pairs, or an `IO` or [`IOContext`](@ref) object whose

doc/src/base/base.md

+1
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ Base.Sys.loadavg
397397
Base.Sys.isexecutable
398398
Base.Sys.isreadable
399399
Base.Sys.iswritable
400+
Base.Sys.which
400401
Base.Sys.username
401402
Base.@static
402403
```

src/jltypes.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3683,7 +3683,7 @@ void jl_init_types(void) JL_GC_DISABLED
36833683
jl_uint16_type,
36843684
jl_uint16_type,
36853685
//jl_bool_type,
3686-
jl_bool_type,
3686+
jl_uint8_type,
36873687
jl_bool_type,
36883688
jl_any_type, jl_any_type), // fptrs
36893689
jl_emptysvec,

0 commit comments

Comments
 (0)