native: demo for a call to haskell functions at runtime
[mate.git] / Mate / GarbageAlloc.hs
index 56bb8f17a80cde7cfa65808258fdecaa74a907be..e7c1cc955a266ab09fb3691945fb8aadd1d5272d 100644 (file)
@@ -6,9 +6,7 @@ module Mate.GarbageAlloc where
 import Foreign
 import Foreign.C
 
-#ifdef DEBUG
 import Text.Printf
-#endif
 import Mate.Debug
 
 -- unified place for allocating Memory
@@ -30,3 +28,10 @@ mallocObject size = do
   ptr <- mallocBytes size
   printfStr "mallocObject: %d\n" size
   return $ fromIntegral $ ptrToIntPtr ptr
+
+-- TODO: delete me
+foreign export ccall demoInterfaceCall :: CUInt -> IO ()
+demoInterfaceCall :: CUInt -> IO ()
+demoInterfaceCall val = do
+  printf "demoInterfaceCall: 0x%08x\n" (fromIntegral val :: Word32)
+  return ()