Skip to content
  • Duncan Coutts's avatar
    Add an IOManager API for scavenging TSO blocked_info · 4161f516
    Duncan Coutts authored and Marge Bot's avatar Marge Bot committed
    When the GC scavenges a TSO it needs to scavenge the tso->blocked_info
    but the blocked_info is a big union and what lives there depends on the
    two->why_blocked, which for I/O-related reasons is something that in
    principle is the responsibility of the I/O manager and not the GC. So
    the right thing to do is for the GC to ask the I/O manager to sscavenge
    the blocked_info if it encounters any I/O-related why_blocked reasons.
    
    So we add scavengeTSOIOManager in IOManager.{h,c} with the usual style.
    
    Now as it happens, right now, there is no special scavenging to do, so
    the implementation of scavengeTSOIOManager is a fancy no-op. That's
    because the select I/O manager uses only the fd and target members,
    which are not GC pointers, and the win32-legacy I/O manager _ought_ to
    be using GC-managed heap objects for the StgAsyncIOResult but it is
    actually usingthe C heap, so again no GC pointers. If the win32-legacy
    were doing this more sensibly, then scavengeTSOIOManager would be the
    right place to do the GC magic.
    
    Future I/O managers will need GC heap objects in the tso->blocked_info
    and will make use of this functionality.
    4161f516