[Git][ghc/ghc][master] Unpack the MVar in Compact

Marge Bot gitlab at gitlab.haskell.org
Sat Sep 19 19:51:49 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
b26cd867 by David Feuer at 2020-09-19T15:51:44-04:00
Unpack the MVar in Compact

The `MVar` lock in `Compact` was unnecessarily lazy, creating an extra indirection and wasting two words. Make it strict.
- - - - -


1 changed file:

- libraries/ghc-compact/GHC/Compact.hs


Changes:

=====================================
libraries/ghc-compact/GHC/Compact.hs
=====================================
@@ -136,7 +136,7 @@ import GHC.Types
 -- If compaction encounters any of the above, a 'Control.Exception.CompactionFailed'
 -- exception will be thrown by the compaction operation.
 --
-data Compact a = Compact Compact# a (MVar ())
+data Compact a = Compact Compact# a !(MVar ())
     -- we can *read* from a Compact without taking a lock, but only
     -- one thread can be writing to the compact at any given time.
     -- The MVar here is to enforce mutual exclusion among writers.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b26cd86795d86850bfa97aa020d0a46b8ac043da

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b26cd86795d86850bfa97aa020d0a46b8ac043da
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200919/66a99a6a/attachment.html>


More information about the ghc-commits mailing list