[GHC] #7718: ios patch no 8: adjustor pools

GHC cvs-ghc at haskell.org
Sun Apr 28 12:14:16 CEST 2013


#7718: ios patch no 8: adjustor pools
--------------------------------+-------------------------------------------
  Reporter:  StephenBlackheath  |          Owner:         
      Type:  feature request    |         Status:  patch  
  Priority:  normal             |      Milestone:  7.8.1  
 Component:  Compiler           |        Version:  7.7    
Resolution:                     |       Keywords:         
        Os:  Other              |   Architecture:  arm    
   Failure:  None/Unknown       |     Difficulty:  Unknown
  Testcase:                     |      Blockedby:         
  Blocking:  7724               |        Related:         
--------------------------------+-------------------------------------------

Comment(by StephenBlackheath):

 Reminding myself of the reason...

 I believe I was slightly wrong with what I just said: the 'exec' and
 'write' pointer being the same is not the issue. Here's a more accurate
 explanation:

 On iOS, ffi_prep_closure_loc must be used to construct the closure
 (because that is the only way to get around Apple restrictions). It
 requires the exec and writable pointers to be exactly the ones returned by
 ffi_closure_alloc. No such limitation exists on Linux because we are
 creating our own closures.

 createAdjustor returns only the exec pointer, so this is all that freeExec
 can receive initially.

 I can use the same trick as on Linux to go from writable -> exec. However,
 I can't use the same trick for exec -> writable, because it requires me to
 write into the memory, and the exec pointer is not writable! Therefore the
 hash table is the only way.

 Note that the Linux code writes into the writable pointer and reads from
 the exec pointer. Therefore they MUST be the same address, or it would not
 retrieve the same value. The whole business of writing into the pointer
 and advancing it by one may be totally unnecessary on Linux.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7718#comment:17>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list