Hs2lib-0.5.0: A Library and Preprocessor that makes it easier to create shared libs from Haskell programs.

Portabilityportable
Stabilityexperimental
Maintainertamar@zhox.com

WinDll.Debug.Alloc

Description

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

Synopsis

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)

freeUnknown :: forall a st m. (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), however it does not record the size of the value held by the pointer. as such, it has no need for the Storable requirement

free :: forall a st. (Storable a, Stackable st) => st -> Ptr a -> IO ()Source

Re-export of the Foreign.Marshal.Alloc.free function taking an explicit stack