[Git][ghc/ghc][wip/T24228] base: export System.Mem.performBlockingMajorGC
Teo Camarasu (@teo)
gitlab at gitlab.haskell.org
Wed Feb 14 12:19:52 UTC 2024
Teo Camarasu pushed to branch wip/T24228 at Glasgow Haskell Compiler / GHC
Commits:
ea418793 by Teo Camarasu at 2024-02-14T12:19:27+00: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 <ben at smart-cactus.org>
- - - - -
6 changed files:
- libraries/base/changelog.md
- 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:
=====================================
libraries/base/changelog.md
=====================================
@@ -14,6 +14,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/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
=====================================
@@ -10363,6 +10363,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
=====================================
@@ -13141,6 +13141,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
=====================================
@@ -10649,6 +10649,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
=====================================
@@ -10367,6 +10367,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/-/commit/ea418793de43ccae229c1e263264fda11ca73814
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ea418793de43ccae229c1e263264fda11ca73814
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/20240214/e15a1872/attachment-0001.html>
More information about the ghc-commits
mailing list