X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fghci%2FByteCodeFFI.lhs;h=0f149c38abfb9d7507811447127a1ef5fda41462;hp=5c2b35f1aaa2515d9ab33861dd1c3dec8e420ce3;hb=e9f9ec1e57d53b9302a395ce0d02c0fa59e28341;hpb=e0fcf61dca4dfac99cb5417e1bc4cbee18822cf2 diff --git a/compiler/ghci/ByteCodeFFI.lhs b/compiler/ghci/ByteCodeFFI.lhs index 5c2b35f..0f149c3 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 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}