05e69d0f1a0d6215e0e82292f5b5d86be7b31b8e
[mate.git] / scratch / MemoryManager.hs
1 module MemoryManager ( ) where
2
3 import qualified Foreign.Marshal.Alloc as Alloc
4 import Foreign.Ptr
5 import Foreign.Storable
6
7 class AllocationManager a where
8   mallocBytes :: a -> Int -> (a,Ptr b)
9
10 data TwoSpace = TwoSpace { basePtrA :: IntPtr, basePtrB :: IntPtr, heapPtrA :: IntPtr, heapPtrB :: IntPtr }
11
12 instance AllocationManager TwoSpace where
13   mallocBytes = mallocBytes'
14
15 mallocBytes' :: TwoSpace -> Int -> (TwoSpace, Ptr a)
16 mallocBytes' = undefined