on master help sign in
Use strict version of atomicModifyIORef' to prevent a memory leak in certain cases
commita2899f1e47a0849e9457888624ef939b9485dc30 authorHans-Christian Esperer <hc@hcesperer.org> dateTue 5 Jul 2016, 14:42 (10 years ago) parentef4106d
1 file changed+1−1
wai-extra/Network/Wai/Parse.hs+1−1
wai-extra/Network/Wai/Parse.hs+1−1
@@ -586,7 +586,7 @@ wrapTillBound bound src max' = do
586586 WTBDone _ -> return S.empty
587587 WTBWorking front -> do
588588 bs <- readSource src
589− cur <- atomicModifyIORef sref $ \ cur ->
589+ cur <- atomicModifyIORef' sref $ \ cur ->
590590 let new = cur + fromIntegral (S.length bs) in (new, new)
591591 case max' of
592592 Just max'' | cur > max'' -> error "Maximum size exceeded"