Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,400
    • Issues 5,400
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 591
    • Merge requests 591
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #7718
Closed
Open
Issue created Feb 25, 2013 by StephenBlackheath@trac-StephenBlackheath

ios patch no 8: adjustor pools

"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.

  1. The Haskell code in the compiler to generate the stubs for the pooled adjustors.
  2. The runtime system's implementation of pooled adjustors in C.
Edited Mar 09, 2019 by Ian Lynagh <igloo@earth.li>
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking