Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Source project has a limited visibility.
  • Duncan Coutts's avatar
    f78f8d18
    Add test T17747 · f78f8d18
    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
    History
    Add test T17747
    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.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.