Maintainer | Bas van Dijk <v.dijk.bas@gmail.com> |
---|
Unsafe functions for constructing regional pointers, retrieving the native
Ptr
from a regional pointer and for lifting operations on Ptrs
to
RegionalPtrs
.
- unsafeRegionalPtr :: MonadIO pr => Ptr α -> CloseAction -> RegionT s pr (RegionalPtr α (RegionT s pr))
- unsafePureRegionalPtr :: Ptr α -> RegionalPtr α r
- unsafePtr :: RegionalPtr α r -> Ptr α
- unsafeWrap :: MonadIO m => (Ptr α -> IO β) -> RegionalPtr α r -> m β
- unsafeWrap2 :: MonadIO m => (Ptr α -> γ -> IO β) -> RegionalPtr α r -> γ -> m β
- unsafeWrap3 :: MonadIO m => (Ptr α -> γ -> δ -> IO β) -> RegionalPtr α r -> γ -> δ -> m β
Unsafely constructing regional pointers
unsafeRegionalPtr :: MonadIO pr => Ptr α -> CloseAction -> RegionT s pr (RegionalPtr α (RegionT s pr))Source
Construct a regional pointer from a native pointer
and an IO
computation that finalizes the pointer (like free ptr
)
which is executed when the region exits.
This function is considered unsafe because this library can't guarantee that
the finalizer will actually finalize the pointer (suppose having return ()
as the finalizer). You have to verify the correct finalisation yourself.
unsafePureRegionalPtr :: Ptr α -> RegionalPtr α rSource
Construct a regional pointer from a native pointer
without registering a finalizer like free ptr
.
This function is considered unsafe because this library can't guarantee the finalisation of the pointer, you have to do that yourself.
Unsafe utility functions for lifting operations on Ptrs
to RegionalPtrs
unsafePtr :: RegionalPtr α r -> Ptr αSource
unsafeWrap :: MonadIO m => (Ptr α -> IO β) -> RegionalPtr α r -> m βSource
unsafeWrap2 :: MonadIO m => (Ptr α -> γ -> IO β) -> RegionalPtr α r -> γ -> m βSource
unsafeWrap3 :: MonadIO m => (Ptr α -> γ -> δ -> IO β) -> RegionalPtr α r -> γ -> δ -> m βSource