Skip to content

Commit

Permalink
fix functional assert statements
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 14, 2024
1 parent 0f04b33 commit cdcb0af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3770,7 +3770,7 @@ function precompile(@nospecialize(argt::Type), m::Method)
return precompile(mi)
end

@assert precompile(include_package_for_output, (PkgId, String, Vector{String}, Vector{String}, Vector{String}, typeof(_concrete_dependencies), Nothing))
@assert precompile(include_package_for_output, (PkgId, String, Vector{String}, Vector{String}, Vector{String}, typeof(_concrete_dependencies), String))
@assert precompile(create_expr_cache, (PkgId, String, String, String, typeof(_concrete_dependencies), Cmd, IO, IO))
@assert precompile(create_expr_cache, (PkgId, String, String, Nothing, typeof(_concrete_dependencies), Cmd, IO, IO))
precompile(include_package_for_output, (PkgId, String, Vector{String}, Vector{String}, Vector{String}, typeof(_concrete_dependencies), Nothing)) || @assert false
precompile(include_package_for_output, (PkgId, String, Vector{String}, Vector{String}, Vector{String}, typeof(_concrete_dependencies), String)) || @assert false
precompile(create_expr_cache, (PkgId, String, String, String, typeof(_concrete_dependencies), Cmd, IO, IO)) || @assert false
precompile(create_expr_cache, (PkgId, String, String, Nothing, typeof(_concrete_dependencies), Cmd, IO, IO)) || @assert false
3 changes: 2 additions & 1 deletion base/pkgid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ end

function binunpack(s::String)
io = IOBuffer(s)
@assert read(io, UInt8) === 0x00
z = read(io, UInt8)
@assert z === 0x00
uuid = read(io, UInt128)
name = read(io, String)
return PkgId(UUID(uuid), name)
Expand Down
6 changes: 4 additions & 2 deletions base/threadingconstructs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ function threading_run(fun, static)
else
# TODO: this should be the current pool (except interactive) if there
# are ever more than two pools.
@assert ccall(:jl_set_task_threadpoolid, Cint, (Any, Int8), t, _sym_to_tpid(:default)) == 1
_result = ccall(:jl_set_task_threadpoolid, Cint, (Any, Int8), t, _sym_to_tpid(:default))
@assert _result == 1
end
tasks[i] = t
schedule(t)
Expand Down Expand Up @@ -410,7 +411,8 @@ function _spawn_set_thrpool(t::Task, tp::Symbol)
if tpid == -1 || _nthreads_in_pool(tpid) == 0
tpid = _sym_to_tpid(:default)
end
@assert ccall(:jl_set_task_threadpoolid, Cint, (Any, Int8), t, tpid) == 1
_result = ccall(:jl_set_task_threadpoolid, Cint, (Any, Int8), t, tpid)
@assert _result == 1
nothing
end

Expand Down

0 comments on commit cdcb0af

Please sign in to comment.