GC: first working version of boehm gc. working with: 8af66bf9d36f75558ec49e0461099d5f...
[mate.git] / Mate / MethodPool.hs
index 73f47c090a76259fde609f4b1139a28a4191baca..da3e5e055808de09698423cc8173a4d3929178aa 100644 (file)
@@ -32,6 +32,7 @@ import Mate.NativeMachine
 import Mate.ClassPool
 import Mate.Debug
 import Mate.Utilities
+import Mate.GarbageAlloc
 
 foreign import ccall "dynamic"
    code_void :: FunPtr (IO ()) -> IO ()
@@ -39,7 +40,9 @@ foreign import ccall "dynamic"
 foreign import ccall "&demoInterfaceCall"
   demoInterfaceCallAddr :: FunPtr (CUInt -> IO ())
 
-
+foreign import ccall "&printMemoryUsage"
+  printMemoryUsageAddr :: FunPtr (IO ())
 getMethodEntry :: CPtrdiff -> CPtrdiff -> IO CPtrdiff
 getMethodEntry signal_from methodtable = do
   mmap <- getMethodMap
@@ -73,6 +76,8 @@ getMethodEntry signal_from methodtable = do
                   case smethod of
                     "demoInterfaceCall" ->
                        return . funPtrToAddr $ demoInterfaceCallAddr
+                    "printMemoryUsage" ->
+                       return . funPtrToAddr $ printMemoryUsageAddr
                     _ ->
                        error $ "native-call: " ++ smethod ++ " not found."
                 else do