[GHC] #7718: ios patch no 8: adjustor pools
GHC
cvs-ghc at haskell.org
Mon Feb 25 13:15:32 CET 2013
#7718: ios patch no 8: adjustor pools
------------------------------+---------------------------------------------
Reporter: StephenBlackheath | Owner:
Type: feature request | Status: new
Priority: normal | Component: Compiler
Version: 7.7 | Keywords:
Os: Other | Architecture: arm
Failure: None/Unknown | Blockedby:
Blocking: | Related:
------------------------------+---------------------------------------------
"Adjustor" is the term used for a C function pointer that allows C code to
call back to Haskell. Normally these are generated at runtime.
However, the iOS kernel doesn't allow self-modifying code. So, on iOS we
use a pool of precompiled adjustors of a fixed size, and this patch is the
implementation for that.
It consists of three parts:
1. A POOLSIZE pragma, that is used like this:
foreign import ccall safe "wrapper" {-# POOLSIZE 100 #-}
mkDelegate :: IO () -> IO (FunPtr (IO ()))
This patch makes this pragma work on all platforms, but it'll have no
effect on platforms other than iOS.
I am not sure what the procedure is for additions of pragmas. Do pragmas
require {-# LANGUAGE xx #-} ? Anyway, please review whether the approach
taken here is acceptable.
2. The Haskell code in the compiler to generate the stubs for the pooled
adjustors.
3. The runtime system's implementation of pooled adjustors in C.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7718>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list