X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FByteCodeFFI.lhs;h=1589fe1bed01f11e64dcef3ee3df27397c0f5b07;hb=4f7d5513b25571f0eb091b8af04e2225f2802fed;hp=5c2b35f1aaa2515d9ab33861dd1c3dec8e420ce3;hpb=e0fcf61dca4dfac99cb5417e1bc4cbee18822cf2;p=ghc-hetmet.git diff --git a/compiler/ghci/ByteCodeFFI.lhs b/compiler/ghci/ByteCodeFFI.lhs index 5c2b35f..1589fe1 100644 --- a/compiler/ghci/ByteCodeFFI.lhs +++ b/compiler/ghci/ByteCodeFFI.lhs @@ -5,12 +5,11 @@ ByteCodeGen: Generate machine-code sequences for foreign import \begin{code} -module ByteCodeFFI ( moan64, newExec ) where +module ByteCodeFFI ( moan64 ) where import Outputable import System.IO -import Foreign -import Foreign.C +import System.IO.Unsafe moan64 :: String -> SDoc -> a moan64 msg pp_rep @@ -25,17 +24,5 @@ moan64 msg pp_rep ) `seq` pprPanic msg pp_rep - -newExec :: Storable a => [a] -> IO (FunPtr ()) -newExec code - = do ptr <- _allocateExec (fromIntegral $ codeSize undefined code) - pokeArray ptr code - return (castPtrToFunPtr ptr) - where - codeSize :: Storable a => a -> [a] -> Int - codeSize dummy array = sizeOf(dummy) * length array - -foreign import ccall unsafe "allocateExec" - _allocateExec :: CUInt -> IO (Ptr a) \end{code}