|
Re: bug: chdman output depends on system qsort() implementation
06/16/12 06:28 PM
|
|
|
> Nobody's disputing that non-glibc qsort() may be unstable, I just want proof that > it's the problem in this case before we make everyone re-convert all their CHDs > *again*. (Because the GCC link indicates that the Linux version of the behavior is > correct, so the created-on-Windows CHDs on all the sites are what will turn out to be > wrong).
glibc qsort isn't guaranteed to be stable either. According to this user, it depends on how much memory the system has...
http://old.nabble.com/Re%3A-RFA%3A-GCC-4.2.1%3A-Stabalizing-coalesce_list%27s-qsort-p12278984.html
Quote:
glibc normally uses merge sort for implementing qsort(), hence it's usually stable. It only uses a real quicksort when using merge sort would require too much memory (defined as more than one quarter of physical RAM). I.e. in practice it's stable.
Looking at the source, this appears to be true... http://sourceware.org/git/?p=glibc.git;a=blob_plain;f=stdlib/msort.c;hb=HEAD
GroovyMAME support forum on BYOAC
|
|