Commit 7384be8c authored by Jan Rasmus Tikovsky 's avatar Jan Rasmus Tikovsky
Browse files

Adapt external implementation of profiling library for compatibility with ghc 8.2.1 and higher

parent 33a3ab5b
......@@ -14,7 +14,16 @@ instance ConvertCurryHaskell C_ProcessInfo C_ProcessInfo where
fromCurry = id
getProcessInfos :: IO [(C_ProcessInfo, Int)]
#if __GLASGOW_HASKELL__ > 702
#if __GLASGOW_HASKELL__ > 802
getProcessInfos = do
stats <- getRTSStats
return [ (C_RunTime , fromIntegral (mutator_cpu_ns stats * 1000))
, (C_ElapsedTime , fromIntegral (mutator_elapsed_ns stats * 1000))
, (C_Heap , fromIntegral (max_live_bytes stats))
, (C_Memory , fromIntegral (max_live_bytes stats))
, (C_GarbageCollections, fromIntegral (gcs stats))
]
#elif __GLASGOW_HASKELL__ > 702
getProcessInfos = do
stats <- getGCStats
return [ (C_RunTime , floor (mutatorCpuSeconds stats * 1000))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment