Skip to content

Commit 81522a8

Browse files
fix 32bit
1 parent 8ed7c61 commit 81522a8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

base/Base.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ include("weakkeydict.jl")
425425
include("scopedvalues.jl")
426426

427427
# used by task.jl
428-
const task_times_per_thread = ScopedValues.ScopedValue{Vector{UInt}}()
429-
const sleep_times_per_thread = ScopedValues.ScopedValue{Vector{UInt}}()
428+
const task_times_per_thread = ScopedValues.ScopedValue{Vector{UInt64}}() # time_ns always returns UInt64
429+
const sleep_times_per_thread = ScopedValues.ScopedValue{Vector{UInt64}}()
430430

431431
# metaprogramming
432432
include("meta.jl")

base/timing.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,12 @@ macro timed(ex)
633633
Threads.lock_profiling(false))
634634
)
635635
local diff = GC_Diff(gc_num(), stats)
636-
local sched_times = Int[]
637-
for i in 1:Threads.maxthreadid()
636+
local sched_times = Int64[]
637+
for i in 1:length(task_times_per_thread[])
638638
# filter out zeros in task timers which can only happen if nothing was scheduled
639639
if task_times_per_thread[][i] != 0
640640
# subtract task and sleep times from global elapsed time to get scheduling time per thread
641-
push!(sched_times, Int(elapsedtime) - Int(task_times_per_thread[][i]) - Int(sleep_times_per_thread[][i]))
641+
push!(sched_times, Int64(elapsedtime) - Int64(task_times_per_thread[][i]) - Int64(sleep_times_per_thread[][i]))
642642
end
643643
end
644644
local sched_time_avg = isempty(sched_times) ? 0 : sum(sched_times) / length(sched_times)

0 commit comments

Comments
 (0)