primitive-0.3.1: Wrappers for primitive operationsContentsIndex
Data.Primitive.Addr
Portabilitynon-portable
MaintainerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Description
Primitive operations on machine addresses
Synopsis
data Addr = Addr Addr#
nullAddr :: Addr
plusAddr :: Addr -> Int -> Addr
minusAddr :: Addr -> Addr -> Int
remAddr :: Addr -> Int -> Int
indexOffAddr :: Prim a => Addr -> Int -> a
readOffAddr :: (Prim a, PrimMonad m) => Addr -> Int -> m a
writeOffAddr :: (Prim a, PrimMonad m) => Addr -> Int -> a -> m ()
memcpyAddr :: PrimMonad m => Addr -> Addr -> Int -> m ()
Documentation
data Addr
A machine address
Constructors
Addr Addr#
show/hide Instances
nullAddr :: Addr
The null address
plusAddr :: Addr -> Int -> Addr
Offset an address by the given number of bytes
minusAddr :: Addr -> Addr -> Int
Distance in bytes between two addresses. The result is only valid if the difference fits in an Int.
remAddr :: Addr -> Int -> Int
indexOffAddr :: Prim a => Addr -> Int -> a
Read a value from a memory position given by an address and an offset. The memory block the address refers to must be immutable. The offset is in elements of type a rather than in bytes.
readOffAddr :: (Prim a, PrimMonad m) => Addr -> Int -> m a
Read a value from a memory position given by an address and an offset. The offset is in elements of type a rather than in bytes.
writeOffAddr :: (Prim a, PrimMonad m) => Addr -> Int -> a -> m ()
Write a value to a memory position given by an address and an offset. The offset is in elements of type a rather than in bytes.
memcpyAddr :: PrimMonad m => Addr -> Addr -> Int -> m ()
Produced by Haddock version 2.7.2