Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
-
87db83e2
by Cheng Shao at 2026-04-24T14:37:21-04:00
-
17e3a0b7
by Cheng Shao at 2026-04-24T14:37:21-04:00
4 changed files:
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- + changelog.d/binary-array-no-list
- compiler/GHC/Utils/Binary.hs
Changes:
| ... | ... | @@ -445,7 +445,7 @@ opsysVariables _ FreeBSD14 = mconcat |
| 445 | 445 | -- Prefer to use the system's clang-based toolchain and not gcc
|
| 446 | 446 | , "CC" =: "cc"
|
| 447 | 447 | , "CXX" =: "c++"
|
| 448 | - , "FETCH_GHC_VERSION" =: "9.10.1"
|
|
| 448 | + , "FETCH_GHC_VERSION" =: "9.10.3"
|
|
| 449 | 449 | , "CABAL_INSTALL_VERSION" =: "3.14.2.0"
|
| 450 | 450 | ]
|
| 451 | 451 | opsysVariables arch (Linux distro) = distroVariables arch distro
|
| ... | ... | @@ -1721,7 +1721,7 @@ |
| 1721 | 1721 | "CC": "cc",
|
| 1722 | 1722 | "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check",
|
| 1723 | 1723 | "CXX": "c++",
|
| 1724 | - "FETCH_GHC_VERSION": "9.10.1",
|
|
| 1724 | + "FETCH_GHC_VERSION": "9.10.3",
|
|
| 1725 | 1725 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 1726 | 1726 | "RUNTEST_ARGS": "",
|
| 1727 | 1727 | "TEST_ENV": "x86_64-freebsd14-validate",
|
| ... | ... | @@ -4543,7 +4543,7 @@ |
| 4543 | 4543 | "CC": "cc",
|
| 4544 | 4544 | "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check",
|
| 4545 | 4545 | "CXX": "c++",
|
| 4546 | - "FETCH_GHC_VERSION": "9.10.1",
|
|
| 4546 | + "FETCH_GHC_VERSION": "9.10.3",
|
|
| 4547 | 4547 | "IGNORE_PERF_FAILURES": "all",
|
| 4548 | 4548 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 4549 | 4549 | "RUNTEST_ARGS": "",
|
| ... | ... | @@ -5643,7 +5643,7 @@ |
| 5643 | 5643 | "CC": "cc",
|
| 5644 | 5644 | "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check",
|
| 5645 | 5645 | "CXX": "c++",
|
| 5646 | - "FETCH_GHC_VERSION": "9.10.1",
|
|
| 5646 | + "FETCH_GHC_VERSION": "9.10.3",
|
|
| 5647 | 5647 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 5648 | 5648 | "RUNTEST_ARGS": "",
|
| 5649 | 5649 | "TEST_ENV": "x86_64-freebsd14-validate"
|
| 1 | +section: compiler
|
|
| 2 | +synopsis: Reduce allocations when (de)serialising `Array` in the `ghc` library.
|
|
| 3 | +issues: #27109
|
|
| 4 | +mrs: !15805
|
|
| 5 | + |
|
| 6 | +description: {
|
|
| 7 | + The `ghc` library's `Binary` instance for `Array` was changed to
|
|
| 8 | + avoid allocating an intermediate list and to omit a redundant length
|
|
| 9 | + field during (de)serialisation.
|
|
| 10 | + |
|
| 11 | + This should only affect the `ghc` library's (de)serialisation code paths,
|
|
| 12 | + primarily when parsing HIE files and bytecode objects.
|
|
| 13 | +} |
| ... | ... | @@ -142,6 +142,8 @@ import Control.DeepSeq |
| 142 | 142 | import Control.Monad ( when, (<$!>), unless, forM_, void )
|
| 143 | 143 | import Foreign hiding (bit, setBit, clearBit, shiftL, shiftR, void)
|
| 144 | 144 | import Data.Array
|
| 145 | +import Data.Array.Base (unsafeFreezeIOArray)
|
|
| 146 | +import Data.Array.IArray (traverseArray_)
|
|
| 145 | 147 | import Data.Array.IO
|
| 146 | 148 | import Data.Array.Unsafe
|
| 147 | 149 | import qualified Data.Binary as Binary
|
| ... | ... | @@ -970,11 +972,12 @@ instance Binary a => Binary (NonEmpty a) where |
| 970 | 972 | instance (Ix a, Binary a, Binary b) => Binary (Array a b) where
|
| 971 | 973 | put_ bh arr = do
|
| 972 | 974 | put_ bh $ bounds arr
|
| 973 | - put_ bh $ elems arr
|
|
| 975 | + traverseArray_ (put_ bh) arr
|
|
| 976 | + |
|
| 974 | 977 | get bh = do
|
| 975 | - bounds <- get bh
|
|
| 976 | - xs <- get bh
|
|
| 977 | - return $ listArray bounds xs
|
|
| 978 | + (l, u) <- get bh
|
|
| 979 | + marr <- newGenArray (l, u) $ \_ -> get bh
|
|
| 980 | + unsafeFreezeIOArray marr
|
|
| 978 | 981 | |
| 979 | 982 | instance Binary a => Binary (SmallArray a) where
|
| 980 | 983 | put_ bh sa = do
|