X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mate.git;a=blobdiff_plain;f=Mate%2FMethodPool.hs;h=da3e5e055808de09698423cc8173a4d3929178aa;hp=73f47c090a76259fde609f4b1139a28a4191baca;hb=3573020fca0413c6d7823e2a1d70108f25766db0;hpb=69737e443614cbe6c2acec6c3f7f6918325d4435 diff --git a/Mate/MethodPool.hs b/Mate/MethodPool.hs index 73f47c0..da3e5e0 100644 --- a/Mate/MethodPool.hs +++ b/Mate/MethodPool.hs @@ -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