[GHC] #7718: ios patch no 8: adjustor pools
GHC
cvs-ghc at haskell.org
Thu Mar 28 14:02:24 CET 2013
#7718: ios patch no 8: adjustor pools
--------------------------------+-------------------------------------------
Reporter: StephenBlackheath | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.7
Resolution: | Keywords:
Os: Other | Architecture: arm
Failure: None/Unknown | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: 7724 | Related:
--------------------------------+-------------------------------------------
Comment(by StephenBlackheath):
I forgot to mention that I re-tested this patch on Linux to make sure my
refactoring didn't break it:
{{{
{-# LANGUAGE ForeignFunctionInterface #-}
import Foreign
import Foreign.C
foreign import ccall "wrapper" wrap :: (CInt -> IO CInt) -> IO (FunPtr
(CInt -> IO CInt))
foreign import ccall safe "callme" callme :: (FunPtr (CInt -> IO CInt)) ->
IO ()
main = do
putStrLn "hi"
f <- wrap $ \i -> do
putStrLn $ "haskell got "++show i
return $ i + 1
callme f
freeHaskellFunPtr f
putStrLn "bye"
}}}
{{{
#include <stdio.h>
int callme(int (*f)(int))
{
printf("%d -> %d\n", 5, f(5));
printf("%d -> %d\n", 10, f(10));
}
}}}
{{{
hi
haskell got 5
5 -> 6
haskell got 10
10 -> 11
bye
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7718#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list