Portability | portable |
---|---|
Stability | experimental |
Maintainer | tamar@zhox.com |
These re-exported allocation functions allows us to keep track of memory allocations within our program. We can later analyze this to find memory leaks
- alloca :: forall a b st. (Storable a, Stackable st) => st -> (Ptr a -> IO b) -> IO b
- malloc :: forall a st. (Storable a, Stackable st) => st -> IO (Ptr a)
- realloc :: forall a b st. (Storable b, Stackable st) => st -> Ptr a -> IO (Ptr b)
- record :: forall a st m. (Storable a, Stackable st, Show (m a)) => st -> m a -> IO ()
- recordM :: forall a st b. (Storable a, Stackable st) => st -> b -> (b -> IO (Ptr a)) -> IO (Ptr a)
- freeDefault :: forall a st m. (Storable a, Stackable st, Show (m a)) => st -> m a -> (m a -> IO ()) -> IO ()
- freeUnknown :: forall a st m. (Stackable st, Show (m a)) => st -> m a -> (m a -> IO ()) -> IO ()
- free :: forall a st. (Storable a, Stackable st) => st -> Ptr a -> IO ()
Documentation
alloca :: forall a b st. (Storable a, Stackable st) => st -> (Ptr a -> IO b) -> IO bSource
Re-export of the Foreign.Marshal.Alloc.alloca function taking an explicit stack
malloc :: forall a st. (Storable a, Stackable st) => st -> IO (Ptr a)Source
Re-export of the Foreign.Marshal.Alloc.malloc function taking an explicit stack
realloc :: forall a b st. (Storable b, Stackable st) => st -> Ptr a -> IO (Ptr b)Source
Re-export of the Foreign.Marshal.Alloc.realloc function taking an explicit stack
record :: forall a st m. (Storable a, Stackable st, Show (m a)) => st -> m a -> IO ()Source
This function record the allocation information about a Ptr we couldn't override it's allocation function for.
recordM :: forall a st b. (Storable a, Stackable st) => st -> b -> (b -> IO (Ptr a)) -> IO (Ptr a)Source
This function mirrors record in its function. Except that the value it's given might not be a ptr value
freeDefault :: forall a st m. (Storable a, Stackable st, Show (m a)) => st -> m a -> (m a -> IO ()) -> IO ()Source
Free a ptr that is not a normal Ptr type, (e.g. ForeignPtr etc)