import Foreign
import Foreign.C
-#ifdef DEBUG
import Text.Printf
-#endif
import Mate.Debug
-- unified place for allocating Memory
printfStr "mallocString: %d\n" size
mallocBytes size
-foreign export ccall mallocObject :: Int -> IO CUInt
-mallocObject :: Int -> IO CUInt
+foreign export ccall mallocObject :: Int -> IO CPtrdiff
+mallocObject :: Int -> IO CPtrdiff
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 ()