|
| Foreign.Marshal.Alloc | | Portability | portable | | Stability | provisional | | Maintainer | ffi@haskell.org |
|
|
|
|
|
| Description |
| Marshalling support: basic routines for memory allocation
|
|
| Synopsis |
|
|
|
|
| Allocation |
|
| malloc :: (Storable a) => IO (Ptr a) |
| Allocate space for storable type. The size of the area allocated
is determined by the sizeOf method from the instance of
Storable for the appropriate type.
|
|
| mallocBytes :: Int -> IO (Ptr a) |
| Allocate given number of bytes of storage, equivalent to C's malloc().
|
|
| alloca :: (Storable a) => (Ptr a -> IO b) -> IO b |
Temporarily allocate space for a storable type. |
|
| allocaBytes :: Int -> (Ptr a -> IO b) -> IO b |
Temporarily allocate the given number of bytes of storage. |
|
| realloc :: (Storable b) => Ptr a -> IO (Ptr b) |
| Adjust a malloc'ed storage area to the given size of the required type
(corresponds to C's realloc()).
|
|
| reallocBytes :: Ptr a -> Int -> IO (Ptr a) |
| Adjust a malloc'ed storage area to the given size (equivalent to
C's realloc()).
|
|
| free :: Ptr a -> IO () |
| Free malloc'ed storage (equivalent to
C's free())
|
|
| Produced by Haddock version 0.4 |