Skip to content

rts: Major refactor of adjustor logic

Ben Gamari requested to merge wip/libffi into master

This is a major refactoring and clean-up of the logic surrounding adjustors and executable region mapping, motivated by our current mis-use of ffi_closure_alloc which results in #20051 (closed). In short we:

  • Break Adjustors.c up into a number of platform-specific files and the libffi backend, significantly improving readability. Note that I do not drop the Alpha, SPARC or IA64 implementations despite having no means of testing on these platforms.
  • Introduce ExecPage, a new, quite thin abstraction for allocating and later protecting single executable pages.
  • Teach the Adjustors implementations to use ExecPage instead of allocateExec
  • Refactor GHCi to use ExecPage instead of allocateExec and allocateWrite
  • Remove allocateExec and friends as they are now unused

Fixes #20051 (closed).

Edited by Ben Gamari

Merge request reports