sort: Allocate space for sort buffers on demand, not in advance. 20120319030503/pspp 20120320030503/pspp 20120321030502/pspp 20120322030503/pspp
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 19 Mar 2012 04:40:49 +0000 (21:40 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 19 Mar 2012 04:41:40 +0000 (21:41 -0700)
commitc13310dc3fc3c312c7a71be1b2918d4670c45a1a
treeb6b4032b42e77137d5a02447976727894a95d6fb
parent82c5350ac535a6d966519759b9505984768520fd
sort: Allocate space for sort buffers on demand, not in advance.

Each call to sort_create_writer() was allocating possibly a very
large amount of memory when in many cases only a small fraction of
that memory would actually be used.  This commit switches to
allocating a small amount of memory and gradually increasing the
allocation on demand.

Reported by John Darrington.
Bug #35887.
src/math/sort.c