projects
/
mate.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
native: demo for a call to haskell functions at runtime
[mate.git]
/
Mate
/
GarbageAlloc.hs
diff --git
a/Mate/GarbageAlloc.hs
b/Mate/GarbageAlloc.hs
index 56bb8f17a80cde7cfa65808258fdecaa74a907be..e7c1cc955a266ab09fb3691945fb8aadd1d5272d 100644
(file)
--- a/
Mate/GarbageAlloc.hs
+++ b/
Mate/GarbageAlloc.hs
@@
-6,9
+6,7
@@
module Mate.GarbageAlloc where
import Foreign
import Foreign.C
import Foreign
import Foreign.C
-#ifdef DEBUG
import Text.Printf
import Text.Printf
-#endif
import Mate.Debug
-- unified place for allocating Memory
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
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 ()