diff options
author | Simon Marlow <marlowsd@gmail.com> | 2015-09-23 13:13:28 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2015-09-23 13:14:29 -0500 |
commit | 453cdbfcea6962d0a2b5f532b5cdf53d5f82143d (patch) | |
tree | 8d914400c56aaed9d664877968890429f7413ba3 /libraries/base/System/Mem.hs | |
parent | 73921df27cac0615d2272b8729381aa0f229a0c8 (diff) | |
download | haskell-453cdbfcea6962d0a2b5f532b5cdf53d5f82143d.tar.gz |
base: export allocation counter/limit API from System.Mem
Previously it was only available from GHC.Conc, but it makes sense for it to be
available from a more official place where people might find it.
While I was here, I improved the docs a little.
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D1272
Diffstat (limited to 'libraries/base/System/Mem.hs')
-rw-r--r-- | libraries/base/System/Mem.hs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/libraries/base/System/Mem.hs b/libraries/base/System/Mem.hs index a894f4d343..c47a52d2f7 100644 --- a/libraries/base/System/Mem.hs +++ b/libraries/base/System/Mem.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE Safe #-} - ----------------------------------------------------------------------------- -- | -- Module : System.Mem @@ -14,17 +12,30 @@ -- ----------------------------------------------------------------------------- +{-# LANGUAGE Trustworthy #-} +-- allocation counter stuff is safe, but GHC.Conc.Sync is Unsafe + module System.Mem - ( performGC + ( + -- * Garbage collection + performGC , performMajorGC , performMinorGC + + -- * Allocation counter and limits + , setAllocationCounter + , getAllocationCounter + , enableAllocationLimit + , disableAllocationLimit ) where --- | Triggers an immediate garbage collection. +import GHC.Conc.Sync + +-- | Triggers an immediate major garbage collection. performGC :: IO () performGC = performMajorGC --- | Triggers an immediate garbage collection. +-- | Triggers an immediate major garbage collection. -- -- @since 4.7.0.0 foreign import ccall "performMajorGC" performMajorGC :: IO () |