+
+mallocObjectUnmanaged :: Int -> IO CPtrdiff
+mallocObjectUnmanaged size = do
+ ptr <- mallocBytes size
+ printfStr "mallocObjectUnmanged: %d\n" size
+ return $ fromIntegral $ ptrToIntPtr ptr
+
+mallocStringUnmanaged :: Int -> IO (Ptr a)
+mallocStringUnmanaged size = do
+ printfStr "mallocStringUnamaged: %d\n" size
+ mallocBytes size
+
+
+getHeapMemory :: IO Int
+getHeapMemory = getHeapSizeGC
+
+foreign export ccall printMemoryUsage :: IO ()
+printMemoryUsage :: IO ()
+printMemoryUsage = getHeapMemory >>= print
+
+foreign export ccall printGCStats :: IO ()
+printGCStats :: IO ()
+printGCStats = putStrLn "Should print GC Stats"