X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FByteCodeFFI.lhs;h=0f149c38abfb9d7507811447127a1ef5fda41462;hb=d436c70d43fb905c63220040168295e473f4b90a;hp=649efc06304643ef1aee025d6bbd02f5a8629e0b;hpb=c3062251034f54944061e816ed018b0b2db1b849;p=ghc-hetmet.git diff --git a/compiler/ghci/ByteCodeFFI.lhs b/compiler/ghci/ByteCodeFFI.lhs index 649efc0..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,19 +24,5 @@ moan64 msg pp_rep ) `seq` pprPanic msg pp_rep - -newExec :: Storable a => [a] -> IO (FunPtr ()) -newExec code - = alloca $ \pcode -> do - ptr <- _allocateExec (fromIntegral $ codeSize undefined code) pcode - pokeArray ptr code - code <- peek pcode - return (castPtrToFunPtr code) - where - codeSize :: Storable a => a -> [a] -> Int - codeSize dummy array = sizeOf(dummy) * length array - -foreign import ccall unsafe "allocateExec" - _allocateExec :: CUInt -> Ptr (Ptr a) -> IO (Ptr a) \end{code}