• Andres Freund's avatar
    Ensure sufficient alignment for ParallelTableScanDescData in BTShared. · 8cacea7a
    Andres Freund authored
    Previously ParallelTableScanDescData was just a member in BTShared,
    but after c2fe139c that doesn't guarantee sufficient alignment as
    specific AMs might (are likely to) need atomic variables in the
    struct.
    
    One might think that MAXALIGNing would be sufficient, but as a
    comment in shm_toc_allocate() explains, that's not enough. For now,
    copy the hack described there.
    
    For parallel sequential scans no such change is needed, as its
    allocations go through shm_toc_allocate().
    
    An alternative approach would have been to allocate the parallel scan
    descriptor in a separate TOC entry, but there seems little benefit in
    doing so.
    
    Per buildfarm member dromedary.
    
    Author: Andres Freund
    Discussion: https://postgr.es/m/20190311203126.ty5gbfz42gjbm6i6@alap3.anarazel.de
    8cacea7a
nbtsort.c 53.5 KB