1 {-# LANGUAGE ForeignFunctionInterface #-}
2 module Mate.GarbageAlloc where
7 -- unified place for allocating Memory
8 -- TODO: implement GC stuff ;-)
10 mallocClassData :: Int -> IO (Ptr a)
11 mallocClassData = mallocBytes
13 mallocString :: Int -> IO (Ptr a)
14 mallocString = mallocBytes
16 foreign export ccall mallocObject :: Int -> IO CUInt
17 mallocObject :: Int -> IO CUInt
18 mallocObject size = do
19 ptr <- mallocBytes size
20 return $ fromIntegral $ ptrToIntPtr ptr