<div dir="ltr"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>><br>
> Mergesort is actually not good compared to quicksort because of memory<br>
> requirements.<br>
<br>
As Adhemerval mentioned the rational can be found in the 'git log' or on<br>
the mailing list archives [1].<br>
<br>
There are programs that expect the sorting to be stable. I have never<br>
run into a program running out of memory using qsort.<br>
<br>
Collin<br>
<br>
[1] <a href="https://inbox.sourceware.org/libc-alpha/a0b8e28438edc5295b33ac280325847314ae7dcc.camel@xry111.site/T/#m2646a2c7a392ef12791a53ddf39db260358768cb" rel="noreferrer" target="_blank">https://inbox.sourceware.org/libc-alpha/a0b8e28438edc5295b33ac280325847314ae7dcc.camel@xry111.site/T/#m2646a2c7a392ef12791a53ddf39db260358768cb</a></blockquote><div><br></div><div>I read this and it mentions both the pros and cons of mergesort. From this, I gathered that mergesort was done because it is a stable sort.</div><div><br></div><div>But this thread also mentions shortcomings of mergesort:</div><div><br></div><div>====</div><div>The drawback is mergesort requires O(n) extra space, and since it is<br>allocated with malloc the function is AS-signal-unsafe.  It should be<br>feasible to change it to use mmap, although I am not sure how urgent<br>it is.  The heapsort is also nonstable, so programs that require a<br>stable sort would still be subject to this latent issue.</div><div>====</div><div><br></div><div>----</div><div><br></div></div></div>