Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
1d0fb43f
Commit
1d0fb43f
authored
Nov 08, 1998
by
sof
Browse files
[project @ 1998-11-08 17:12:53 by sof]
Added {read,write}StablePtrOffAddr
parent
57d07fb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/lib/exts/Addr.lhs
View file @
1d0fb43f
...
...
@@ -38,7 +38,7 @@ import Int ( indexInt8OffAddr, indexInt16OffAddr
import PrelIOBase ( IO(..), IOResult(..) )
#ifndef __PARALLEL_HASKELL__
import PrelForeign ( ForeignObj(..) )
import PrelForeign ( ForeignObj(..)
, StablePtr(..)
)
#endif
\end{code}
...
...
@@ -98,6 +98,9 @@ readCharOffAddr a i = _casm_ `` %r=(StgChar)(((StgChar*)%0)[(StgInt)%1]); '' a i
readIntOffAddr :: Addr -> Int -> IO Int
readIntOffAddr a i = _casm_ `` %r=(StgInt)(((StgInt*)%0)[(StgInt)%1]); '' a i
readStablePtrOffAddr :: Addr -> Int -> IO (StablePtr a)
readStablePtrOffAddr a i = _casm_ `` %r=(StgStablePtr)(((StgStablePtr*)%0)[(StgInt)%1]); '' a i
readWordOffAddr :: Addr -> Int -> IO Word
readWordOffAddr a i = _casm_ `` %r=(StgWord)(((StgWord*)%0)[(StgInt)%1]); '' a i
...
...
@@ -121,6 +124,10 @@ writeIntOffAddr :: Addr -> Int -> Int -> IO ()
writeIntOffAddr (A# a#) (I# i#) (I# e#) = IO $ \ s# ->
case (writeIntOffAddr# a# i# e# s#) of s2# -> IOok s2# ()
writeStablePtrOffAddr :: Addr -> Int -> StablePtr a -> IO ()
writeStablePtrOffAddr (A# a#) (I# i#) (StablePtr e#) = IO $ \ s# ->
case (writeStablePtrOffAddr# a# i# e# s#) of s2# -> IOok s2# ()
writeWordOffAddr :: Addr -> Int -> Word -> IO ()
writeWordOffAddr (A# a#) (I# i#) (W# e#) = IO $ \ s# ->
case (writeWordOffAddr# a# i# e# s#) of s2# -> IOok s2# ()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment