Use OncePerTask instead of a handmade thread local cache#123
Conversation
nickrobinson251
left a comment
There was a problem hiding this comment.
I can't tell if _divpow10! is covered by tests or not (and Coverage doesn't seem to be working on this repo)... but this looks correct to me
(and if it is covered, Nightly passes!)
Thanks!
| end | ||
|
|
||
| function _divpow10!(x::BigInt, code, pow, ::RoundingMode{:Throw}) | ||
| @inbounds y = Parsers.access_threaded(() -> (@static VERSION > v"1.5" ? BigInt(; nbits=256) : BigInt()), _BIGINT_10s) # we must not yield here! |
There was a problem hiding this comment.
we've dropped the @inbounds here -- tbh i can't see where there would be bounds-checking that this disables, but perhaps there is somewhere in a nested call? (or maybe access_threaded meant to have a @boundscheck but didn't?)
probably it's fine to drop (but i wish this repo had benchmarks)
There was a problem hiding this comment.
It seems to me that access_threaded already elides bounds checking, so this should be fine
I've very scientifically added an |
Mostly copy-pasted the identical fix from JuliaData/Parsers.jl#195
Fixes: #120
Bumps version to
0.6.4