Commits on Source (7)
-
Duncan Coutts authored
Closes issue #17747 Test that we can allocate ByteArray#s outside of the HEAP_ALLOCED() address space without upsetting the GC. To be extra sure we attach weak pointers with C finalizers to the ByteArray#s. We keep them alive and run a major GC so that the GC has to trace the live ByteArray#s. Prior to the first patch in this series, doing this would upset the GC because the GC does not expect heap objects with closure type ARR_WORDS to exist outside the GC heap. > internal error: evacuate(static): strange closure type 42 Finally we allow everything to be GC'd again, and check that the C finalizers did run. This feature also required a change to the isByteArrayPinned# which itself required a CMM implementation of the HEAP_ALLOCED system. So we also add a check that the CMM and C implementations of HEAP_ALLOCED agree with each other.
f78f8d18 -
Duncan Coutts authored
Add a sub-subsection in the chapter on GHC extensions to the FFI, under the existing Memory Allocation subsection. Explain that it's permitted to have {Mutable}ByteArray# outside the heap and the tricky associated constraints. Mention the new primop placeByteArray#.
d865aeb5 -
Duncan Coutts authoredc1026fbb
-
Duncan Coutts authored
And refer to it from the various places involved in the scheme.
2a7a4473 -
Duncan Coutts authored1bbc6d10
-
davide authoredaf028932
-
Reinier Maas authored22478993
Showing
- compiler/GHC/Builtin/primops.txt.pp 73 additions, 2 deletionscompiler/GHC/Builtin/primops.txt.pp
- docs/users_guide/exts/ffi.rst 31 additions, 0 deletionsdocs/users_guide/exts/ffi.rst
- rts/Inlines.c 1 addition, 1 deletionrts/Inlines.c
- rts/PrimOps.cmm 3 additions, 2 deletionsrts/PrimOps.cmm
- rts/include/rts/storage/HeapAlloc.h 7 additions, 1 deletionrts/include/rts/storage/HeapAlloc.h
- rts/sm/Evac.c 1 addition, 0 deletionsrts/sm/Evac.c
- testsuite/tests/interface-stability/base-exports.stdout 2 additions, 0 deletionstestsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs 2 additions, 0 deletions...ce-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32 2 additions, 0 deletions...ite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32 2 additions, 0 deletions...suite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/rts/Makefile 6 additions, 0 deletionstestsuite/tests/rts/Makefile
- testsuite/tests/rts/T17747.hs 184 additions, 0 deletionstestsuite/tests/rts/T17747.hs
- testsuite/tests/rts/T17747.stdout 8 additions, 0 deletionstestsuite/tests/rts/T17747.stdout
- testsuite/tests/rts/T17747_c.c 28 additions, 0 deletionstestsuite/tests/rts/T17747_c.c
- testsuite/tests/rts/T17747_cmm.cmm 18 additions, 0 deletionstestsuite/tests/rts/T17747_cmm.cmm
- testsuite/tests/rts/all.T 10 additions, 0 deletionstestsuite/tests/rts/all.T
testsuite/tests/rts/T17747.hs
0 → 100644
testsuite/tests/rts/T17747.stdout
0 → 100644
testsuite/tests/rts/T17747_c.c
0 → 100644
testsuite/tests/rts/T17747_cmm.cmm
0 → 100644