Skip to content

Commit 8fef453

Browse files
committed
Put RoundThrows back + tweak init
1 parent ca33748 commit 8fef453

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/FixedPointDecimals.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,15 @@ end
100100
end
101101

102102
const FD = FixedDecimal
103+
const RoundThrows = RoundingMode{:Throw}()
103104

104105
include("parse.jl")
105106

106107
function __init__()
107-
append!(_BIGINT_10s, [BigInt(0) for i in 0:Threads.nthreads()])
108-
append!(_BIGINT_Rs, [BigInt(0) for i in 0:Threads.nthreads()])
108+
nt = isdefined(Base.Threads, :maxthreadid) ? Threads.maxthreadid() : Threads.nthreads()
109+
# Buffers used in parsing when dealing with BigInts, see _divpow10! in parse.jl
110+
resize!(empty!(_BIGINT_10s), nt)
111+
resize!(empty!(_BIGINT_Rs), nt)
109112
end
110113

111114
(::Type{T})(x::Real) where {T <: FD} = convert(T, x)

0 commit comments

Comments
 (0)