Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype MLockedForeignPtr a = SFP {}
- withMLockedForeignPtr :: forall a b. MLockedForeignPtr a -> (Ptr a -> IO b) -> IO b
- allocMLockedForeignPtr :: Storable a => IO (MLockedForeignPtr a)
- finalizeMLockedForeignPtr :: forall a. MLockedForeignPtr a -> IO ()
- traceMLockedForeignPtr :: (Storable a, Show a) => MLockedForeignPtr a -> IO ()
- mlockedAlloca :: forall a b. CSize -> (Ptr a -> IO b) -> IO b
- mlockedAllocaSized :: forall n b. KnownNat n => (SizedPtr n -> IO b) -> IO b
- sodiumMalloc :: CSize -> IO (Ptr a)
- sodiumFree :: Ptr a -> IO ()
High-level memory management
newtype MLockedForeignPtr a Source #
Foreign pointer to securely allocated memory.
Instances
NoThunks (MLockedForeignPtr a) Source # | |
Defined in Cardano.Crypto.Libsodium.Memory.Internal |
withMLockedForeignPtr :: forall a b. MLockedForeignPtr a -> (Ptr a -> IO b) -> IO b Source #
allocMLockedForeignPtr :: Storable a => IO (MLockedForeignPtr a) Source #
Allocate secure memory using c_sodium_malloc
.
finalizeMLockedForeignPtr :: forall a. MLockedForeignPtr a -> IO () Source #
traceMLockedForeignPtr :: (Storable a, Show a) => MLockedForeignPtr a -> IO () Source #
Deprecated: Don't leave traceMLockedForeignPtr in production
Low-level memory function
sodiumFree :: Ptr a -> IO () Source #