----------------------------------------------------------------------------- -- | -- Module : Control.Process.GC -- Copyright : (c) 2020-2021 EMQ Technologies Co., Ltd. -- License : BSD-style (see the LICENSE file) -- -- Maintainer : Feng Lee, feng@emqx.io -- Yang M, yangm@emqx.io -- Stability : experimental -- Portability : portable -- -- The Process Garbage Collect module. -- ----------------------------------------------------------------------------- module Control.Process.GC where import Control.Monad (IO) import Data.Pid (Pid) import Data.Ref (Reference) import Data.Unit (Unit) import Control.Process.Types import Foreign (ffiIO0, ffiIO1) data GcOption = GcMajor | GcMinor | GcAsync Reference garbageCollect :: Process () garbageCollect = ffiIO0 :erlang :garbage_collect garbageCollectProc :: Pid -> Process () garbageCollectProc = ffiIO1 :erlang :garbage_collect foreign import garbageCollectProcWith :: Pid -> [GcOption] -> Process () foreign import hibernate :: IO () -> Process ()