From 6080ed0182e65d9cd51b9a1d7209ff82a5e41fa5 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Fri, 22 Apr 2022 23:50:59 +0200 Subject: Only works from ghc 8.10 onwards --- src/GHC/GC_Hook.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/GHC/GC_Hook.hs b/src/GHC/GC_Hook.hs index b3e1947..250441c 100644 --- a/src/GHC/GC_Hook.hs +++ b/src/GHC/GC_Hook.hs @@ -1,3 +1,7 @@ +{-| +Make use of GHC's GC hook functionality from Haskell. This is still a very +bare-bones API. +-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TypeApplications #-} @@ -109,8 +113,9 @@ enableGClogging yes = c_gchook_enable_logging (CBool (if yes then 1 else 0)) -- | Set a C function to be called after every GC. Use this in the following manner: -- -- * Create a file @cbits/something.c@ in your project (the actual file name --- doesn't matter), and add @c-sources: cbits/something.c@ to the stanza of --- the correct component in your .cabal file. +-- doesn't matter), and add @c-sources: cbits/something.c@ (and, if you wish, +-- @cc-options: -Wall@) to the stanza of the correct component in your .cabal +-- file. -- * Put the following in it: (The function names are unimportant.) -- -- > #include "Rts.h" -- cgit v1.2.3-54-g00ecf