%
-% (c) The University of Glasgow 2000
+% (c) The University of Glasgow 2000-2006
%
-\section[ByteCodeItbls]{Generate infotables for interpreter-made bytecodes}
+ByteCodeItbls: Generate infotables for interpreter-made bytecodes
\begin{code}
-
{-# OPTIONS -optc-DNON_POSIX_SOURCE #-}
module ByteCodeItbls ( ItblEnv, ItblPtr, mkITbls ) where
import Foreign
import Foreign.C
-import DATA_BITS ( Bits(..), shiftR )
+import Data.Bits ( Bits(..), shiftR )
import GHC.Exts ( Int(I#), addr2Int# )
-#if __GLASGOW_HASKELL__ < 503
-import Ptr ( Ptr(..) )
-#else
import GHC.Ptr ( Ptr(..) )
-#endif
\end{code}
%************************************************************************
load = do addr <- advance
lift (peek addr)
-foreign import ccall unsafe "stgMallocBytesRWX"
- _stgMallocBytesRWX :: CInt -> IO (Ptr a)
+foreign import ccall unsafe "allocateExec"
+ _allocateExec :: CUInt -> IO (Ptr a)
malloc_exec :: Int -> IO (Ptr a)
-malloc_exec bytes = _stgMallocBytesRWX (fromIntegral bytes)
+malloc_exec bytes = _allocateExec (fromIntegral bytes)
\end{code}