Portability | non-portable |
---|---|
Maintainer | Roman Leshchinskiy <rl@cse.unsw.edu.au> |
Primitive operations on machine addresses
- 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
minusAddr :: Addr -> Addr -> IntSource
Distance in bytes between two addresses. The result is only valid if the
difference fits in an Int
.
indexOffAddr :: Prim a => Addr -> Int -> aSource
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 aSource
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.