[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 3 commits: base: export System.Mem.performBlockingMajorGC

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Feb 16 11:26:57 UTC 2024



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
184c6e4f by Teo Camarasu at 2024-02-16T06:26:45-05:00
base: export System.Mem.performBlockingMajorGC

The corresponding C function was introduced in
ba73a807edbb444c49e0cf21ab2ce89226a77f2e. As part of #22264.

Resolves #24228

The CLC proposal was disccused at: https://github.com/haskell/core-libraries-committee/issues/230

Co-authored-by: Ben Gamari <bgamari.foss at gmail.com>

- - - - -
5348d8b4 by Florian Weimer at 2024-02-16T06:26:49-05:00
Fix C output for modern C initiative

GCC 14 on aarch64 rejects the C code written by GHC with this kind of
error:

   error: assignment to ‘ffi_arg’ {aka ‘long unsigned int’} from ‘HsPtr’ {aka ‘void *’} makes integer from pointer without a cast [-Wint-conversion]
         68 | *(ffi_arg*)resp = cret;
            |                 ^

Add the correct cast.

For more information on this see:
https://fedoraproject.org/wiki/Changes/PortingToModernC

Tested-by: Richard W.M. Jones <rjones at redhat.com>

- - - - -
23a578eb by Matthew Craven at 2024-02-16T06:26:50-05:00
Bump bytestring submodule to 0.12.1.0

- - - - -


8 changed files:

- compiler/GHC/HsToCore/Foreign/C.hs
- libraries/base/changelog.md
- libraries/bytestring
- libraries/ghc-internal/src/System/Mem.hs
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32


Changes:

=====================================
compiler/GHC/HsToCore/Foreign/C.hs
=====================================
@@ -560,7 +560,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc
      ,   ppUnless res_hty_is_unit $
          if libffi
                   then char '*' <> parens (ffi_cResType <> char '*') <>
-                       text "resp = cret;"
+                       text "resp = " <> parens ffi_cResType <> text "cret;"
                   else text "return cret;"
      , rbrace
      ]


=====================================
libraries/base/changelog.md
=====================================
@@ -16,6 +16,7 @@
     ([CLC proposal #166](https://github.com/haskell/core-libraries-committee/issues/166))
   * Export List from Data.List ([CLC proposal #182](https://github.com/haskell/core-libraries-committee/issues/182)).
   * Deprecate `Data.List.NonEmpty.unzip` ([CLC proposal #86](https://github.com/haskell/core-libraries-committee/issues/86))
+  * Add `System.Mem.performMajorGC` ([CLC proposal #230](https://github.com/haskell/core-libraries-committee/issues/230))
   * Fix exponent overflow/underflow bugs in the `Read` instances for `Float` and `Double` ([CLC proposal #192](https://github.com/haskell/core-libraries-committee/issues/192))
   * Implement `many` and `some` methods of `instance Alternative (Compose f g)` explicitly. ([CLC proposal #181](https://github.com/haskell/core-libraries-committee/issues/181))
 


=====================================
libraries/bytestring
=====================================
@@ -1 +1 @@
-Subproject commit ba6918dbb155c1671ffbda4da7d8efff14e5b8f5
+Subproject commit 453c1dc110720a366f90ef84dc2d75a5cd8c28e0


=====================================
libraries/ghc-internal/src/System/Mem.hs
=====================================
@@ -20,6 +20,7 @@ module System.Mem
        -- * Garbage collection
          performGC
        , performMajorGC
+       , performBlockingMajorGC
        , performMinorGC
 
         -- * Allocation counter and limits
@@ -41,6 +42,12 @@ performGC = performMajorGC
 -- @since 4.7.0.0
 foreign import ccall "performMajorGC" performMajorGC :: IO ()
 
+-- | Triggers an immediate major garbage collection, ensuring that collection
+-- finishes before returning.
+--
+-- @since 4.20.0.0
+foreign import ccall "performBlockingMajorGC" performBlockingMajorGC :: IO ()
+
 -- | Triggers an immediate minor garbage collection.
 --
 -- @since 4.7.0.0


=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -10365,6 +10365,7 @@ module System.Mem where
   disableAllocationLimit :: GHC.Types.IO ()
   enableAllocationLimit :: GHC.Types.IO ()
   getAllocationCounter :: GHC.Types.IO GHC.Int.Int64
+  performBlockingMajorGC :: GHC.Types.IO ()
   performGC :: GHC.Types.IO ()
   performMajorGC :: GHC.Types.IO ()
   performMinorGC :: GHC.Types.IO ()


=====================================
testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
=====================================
@@ -13143,6 +13143,7 @@ module System.Mem where
   disableAllocationLimit :: GHC.Types.IO ()
   enableAllocationLimit :: GHC.Types.IO ()
   getAllocationCounter :: GHC.Types.IO GHC.Int.Int64
+  performBlockingMajorGC :: GHC.Types.IO ()
   performGC :: GHC.Types.IO ()
   performMajorGC :: GHC.Types.IO ()
   performMinorGC :: GHC.Types.IO ()


=====================================
testsuite/tests/interface-stability/base-exports.stdout-mingw32
=====================================
@@ -10651,6 +10651,7 @@ module System.Mem where
   disableAllocationLimit :: GHC.Types.IO ()
   enableAllocationLimit :: GHC.Types.IO ()
   getAllocationCounter :: GHC.Types.IO GHC.Int.Int64
+  performBlockingMajorGC :: GHC.Types.IO ()
   performGC :: GHC.Types.IO ()
   performMajorGC :: GHC.Types.IO ()
   performMinorGC :: GHC.Types.IO ()


=====================================
testsuite/tests/interface-stability/base-exports.stdout-ws-32
=====================================
@@ -10369,6 +10369,7 @@ module System.Mem where
   disableAllocationLimit :: GHC.Types.IO ()
   enableAllocationLimit :: GHC.Types.IO ()
   getAllocationCounter :: GHC.Types.IO GHC.Int.Int64
+  performBlockingMajorGC :: GHC.Types.IO ()
   performGC :: GHC.Types.IO ()
   performMajorGC :: GHC.Types.IO ()
   performMinorGC :: GHC.Types.IO ()



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/40c77e92f1bc85d0f673e265f91c88332434ba5f...23a578ebe950ca819ed1d93af749d66d1e3d6c6e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/40c77e92f1bc85d0f673e265f91c88332434ba5f...23a578ebe950ca819ed1d93af749d66d1e3d6c6e
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/20240216/d8a178db/attachment-0001.html>


More information about the ghc-commits mailing list