X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=Mate%2FGarbageAlloc.hs;h=617e571ba6d1407d7ad99200e4724478b94a6a6d;hb=dc7082de1fff3158da5682d683502128b5f6cc0b;hp=c2b622c95f1b6f2f601cbcbbdb6cf3d90a583724;hpb=ccc1ff2921984cfd36595e935e3634842fa2cb7d;p=mate.git diff --git a/Mate/GarbageAlloc.hs b/Mate/GarbageAlloc.hs index c2b622c..617e571 100644 --- a/Mate/GarbageAlloc.hs +++ b/Mate/GarbageAlloc.hs @@ -1,6 +1,4 @@ {-# LANGUAGE ForeignFunctionInterface #-} -{-# LANGUAGE CPP #-} -#include "debug.h" module Mate.GarbageAlloc( mallocClassData, mallocStringGC, @@ -16,7 +14,6 @@ import Foreign.C import Mate.GC.Boehm ---import Text.Printf import Mate.Debug -- unified place for allocating Memory @@ -24,32 +21,32 @@ import Mate.Debug mallocClassData :: Int -> IO (Ptr a) mallocClassData size = do - printfStr "mallocClassData: %d\n" size + printfStr $ printf "mallocClassData: %d\n" size mem <- mallocBytes size addRootGC mem (plusPtr mem size) return mem mallocStringGC :: Int -> IO (Ptr a) mallocStringGC size = do - printfStr "mallocString: %d\n" size + printfStr $ printf "mallocString: %d\n" size mallocBytesGC size foreign export ccall mallocObjectGC :: Int -> IO CPtrdiff mallocObjectGC :: Int -> IO CPtrdiff mallocObjectGC size = do ptr <- mallocBytesGC size - printfStr "mallocObject: %d\n" size + printfStr $ printf "mallocObject: %d\n" size return $ fromIntegral $ ptrToIntPtr ptr mallocObjectUnmanaged :: Int -> IO CPtrdiff mallocObjectUnmanaged size = do ptr <- mallocBytes size - printfStr "mallocObjectUnmanged: %d\n" size + printfStr $ printf "mallocObjectUnmanged: %d\n" size return $ fromIntegral $ ptrToIntPtr ptr mallocStringUnmanaged :: Int -> IO (Ptr a) mallocStringUnmanaged size = do - printfStr "mallocStringUnamaged: %d\n" size + printfStr $ printf "mallocStringUnamaged: %d\n" size mallocBytes size