• Noah Misch's avatar
    Use type "int64" for memory accounting in tuplesort.c/tuplestore.c. · 79e0f87a
    Noah Misch authored
    Commit 263865a4 switched tuplesort.c and
    tuplestore.c variables representing memory usage from type "long" to
    type "Size".  This was unnecessary; I thought doing so avoided overflow
    scenarios on 64-bit Windows, but guc.c already limited work_mem so as to
    prevent the overflow.  It was also incomplete, not touching the logic
    that assumed a signed data type.  Change the affected variables to
    "int64".  This is perfect for 64-bit platforms, and it reduces the need
    to contemplate platform-specific overflow scenarios.  It also puts us
    close to being able to support work_mem over 2 GiB on 64-bit Windows.
    
    Per report from Andres Freund.
    79e0f87a
tuplestore.c 42.9 KB