Skip to content

Permit `ARR_WORDS` closures outside `HEAP_ALLOCED` space

Reinier Maas requested to merge trac-simplifierticks/ghc:wip/T17747 into master

This is a rebase of !2561 on master.

Thank you for your contribution to GHC!

Please take a few moments to verify that your commits fulfill the following:

  • are either individually buildable or squashed
  • have commit messages which describe what they do (referring to [Notes][notes] and tickets using #NNNN syntax when appropriate)
  • have added source comments describing your change. For larger changes you likely should add a [Note][notes] and cross-reference it from the relevant places.
  • add a testcase to the testsuite.

Motivation for this change

We would like to be able to have byte arrays that live off the garbage collector managed heap. Therefore we allow ARR_WORDS closure outside the HEAP_ALLOCED space. We also need to be able to write the ByteArray# header in front of the data, in order to write this C struct we added the placeByteArray# primop.

  • The specific issue that this addresses is #17747
  • The specific branch that this merge request revived is !2561
  • This merge request is part of the GHC workshop of 2023 and was finished during ZuriHac 2024.
Edited by Reinier Maas

Merge request reports