OSDN Git Service

libc: Sync qsort(3) with FreeBSD revision r318515.
authorXin Li <delphij@google.com>
Fri, 19 May 2017 17:13:08 +0000 (10:13 -0700)
committerXin Li <delphij@google.com>
Tue, 13 Jun 2017 18:49:54 +0000 (18:49 +0000)
commit4b1a3992de7803d4c082867ea1168efeaa85cc5d
tree1b6754e8b4fb5da7adb2e5ec33df1844984a3d6f
parent2d36be5912f04c29d0cad15bd37849a10a93e74d
libc: Sync qsort(3) with FreeBSD revision r318515.

r279663: enhance to handle 32-bit aligned data on 64-bit systems

r279666: qsort(3): small style(9) cleanups.

r288030: Use ANSI C prototypes.  Eliminates -Wold-style-definition
warnings.

r318514: Use size_t.

r318515: Reduce the possible recursion level to log2(N) by always
recursing on the smaller partition instead.

Bug: 38450217
Test: builds, ./tests/run-on-host.sh 64
Change-Id: Ieb622e6f54f8f6d6f62e1bdb491d3b5c8e2f9965
libc/upstream-freebsd/lib/libc/stdlib/qsort.c
tests/Android.bp
tests/qsort_test.cpp [new file with mode: 0644]