| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Initialize
Synopsis
- class Storable a => Initialize a where
- class Storable a => Deinitialize a where
- newtype Uninitialized a = Uninitialized a
Documentation
class Storable a => Initialize a where Source #
The class for initializing memory at a pointer
representing Storable values.
Minimal complete definition
Methods
initialize :: Ptr a -> IO () Source #
Initialize the memory at a pointer. An implementation
of this function may do nothing, or if the data contains
more pointers, initialize may allocate additional memory.
initializeElemOff :: Ptr a -> Int -> IO () Source #
Initialize the memory at an offset from the pointer. This has a default implementation but may be overriden for efficiency.
initializeElems :: Ptr a -> Int -> IO () Source #
Initialize a pointer representing an array with a given number of elements. This has a default implementation but may be overriden for efficiency.
Instances
| Initialize Char Source # | |
| Initialize Int Source # | |
| Initialize Int8 Source # | |
| Initialize Int16 Source # | |
| Initialize Int32 Source # | |
| Initialize Int64 Source # | |
| Initialize Word Source # | |
| Initialize Word8 Source # | |
| Initialize Word16 Source # | |
| Initialize Word32 Source # | |
| Initialize Word64 Source # | |
| Storable a => Initialize (Uninitialized a) Source # | |
Defined in Initialize Methods initialize :: Ptr (Uninitialized a) -> IO () Source # initializeElemOff :: Ptr (Uninitialized a) -> Int -> IO () Source # initializeElems :: Ptr (Uninitialized a) -> Int -> IO () Source # | |
class Storable a => Deinitialize a where Source #
The class for freeing memory at a pointer
representing Storable values.
Minimal complete definition
Methods
deinitialize :: Ptr a -> IO () Source #
Free the memory at a pointer.
deinitializeElemOff :: Ptr a -> Int -> IO () Source #
Free the memory at an offset from the pointer. This has a default implementation but may be overriden for efficiency.
deinitializeElems :: Ptr a -> Int -> IO () Source #
Free any memory pointed to by elements of the array. This has a default implementation but may be overriden for efficiency.
Instances
| Deinitialize Char Source # | |
| Deinitialize Int Source # | |
| Deinitialize Int8 Source # | |
| Deinitialize Int16 Source # | |
| Deinitialize Int32 Source # | |
| Deinitialize Int64 Source # | |
| Deinitialize Word Source # | |
| Deinitialize Word8 Source # | |
| Deinitialize Word16 Source # | |
| Deinitialize Word32 Source # | |
| Deinitialize Word64 Source # | |
| Storable a => Deinitialize (Uninitialized a) Source # | |
Defined in Initialize Methods deinitialize :: Ptr (Uninitialized a) -> IO () Source # deinitializeElemOff :: Ptr (Uninitialized a) -> Int -> IO () Source # deinitializeElems :: Ptr (Uninitialized a) -> Int -> IO () Source # | |
newtype Uninitialized a Source #
A type which shares a representation with a, but for which
all underlying memory remains uninitialized - i.e., all typeclass
methods of Initialize and Deinitialize do nothing.
Constructors
| Uninitialized a |