Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type BufferPtr = AlignedBlockPtr BufferAlignment Prim
- data Buffer (n :: Nat)
- withBufferPtr :: KnownNat n => (BufferPtr -> BlockCount Prim -> a) -> Buffer n -> a
- unsafeWithBufferPtr :: KnownNat n => (BufferPtr -> a) -> Buffer n -> a
- memsetBuffer :: KnownNat n => Word8 -> Buffer n -> IO ()
- unsafeGetBufferPointer :: Buffer n -> BufferPtr
- bufferSize :: KnownNat n => Proxy (Buffer n) -> BlockCount Prim
Documentation
type BufferPtr = AlignedBlockPtr BufferAlignment Prim #
data Buffer (n :: Nat) Source #
A buffer buf :: Buffer n
is a memory element that has enough
space for the n
blocks of the primitive and, if required by the
implementation, any additional blocks that might be used for
padding of the last chunk of message.
Instances
KnownNat n => Memory (Buffer n) Source # | |
Defined in Buffer memoryAlloc :: Alloc (Buffer n) unsafeToPointer :: Buffer n -> Ptr Word8 | |
KnownNat n => ReadAccessible (Buffer n) Source # | |
Defined in Buffer beforeReadAdjustment :: Buffer n -> IO () readAccess :: Buffer n -> [Access] | |
KnownNat n => WriteAccessible (Buffer n) Source # | |
Defined in Buffer writeAccess :: Buffer n -> [Access] afterWriteAdjustment :: Buffer n -> IO () |
withBufferPtr :: KnownNat n => (BufferPtr -> BlockCount Prim -> a) -> Buffer n -> a Source #
Run the action on the buffer pointer.
unsafeWithBufferPtr :: KnownNat n => (BufferPtr -> a) -> Buffer n -> a Source #
This takes a buffer pointer action and runs it with the underlying pointer associated with the buffer. The action is supposed to use
Some unsafe functions
unsafeGetBufferPointer :: Buffer n -> BufferPtr Source #
Get the underlying pointer for the buffer.