on master help sign in
Use 0 to initialize IORef instead of undefined

The "undefined" somehow gets evaluated even though it is overwritten immediately. The benchmarks crash due to this.

commit44b0ff2ac30997b219a742b2e12769a4d885ef58 authorHarendra Kumar <harendra@composewell.com> dateWed 10 Feb 2021, 17:10 (6 years ago) parent6c02648
1 file changed+1−1
src/Streamly/Internal/Data/Time/Clock.hs+1−1
src/Streamly/Internal/Data/Time/Clock.hs+1−1
@@ -70,7 +70,7 @@ updateWithDelay clock precision timeVar = do
7070-- writing to it.
7171asyncClock :: Clock -> Double -> IO (ThreadId, Prim.IORef MicroSecond64)
7272asyncClock clock g = do
73− timeVar <- Prim.newIORef undefined
73+ timeVar <- Prim.newIORef 0
7474 updateTimeVar clock timeVar
7575 tid <- forkManaged $ forever (updateWithDelay clock g timeVar)
7676 return (tid, timeVar)