Completely overhaul how we do sorting in -base. GSSorting.h now defines an

interface that can be used for all sorting tasks in the library. The actual sort
algorithms to use are now plugable. Timsort is the new default sorting
algorithm, the existing algorithms, shellsort and quicksort, can still be
selected using a configure switch.

Also implement the new NSComparator (blocks) based sorting and insertion index
searching methods for NSMutableArray and NSArray.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35573 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Niels Grewe 2012-09-19 13:31:09 +00:00
parent e26964a166
commit f8fd11f3fd
18 changed files with 2024 additions and 188 deletions

View file

@ -3266,6 +3266,31 @@ fi
AC_SUBST(USE_GMP)
#--------------------------------------------------------------------
# Check which sorting algorithm to use.
#--------------------------------------------------------------------
AC_ARG_WITH(sort-algorithm,
[ --with-sort-algorithm=ALG force use of a specific sorting algorithm.
Possible values are timsort, quicksort, and shellsort.
Defaults to timsort. Timsort cannot be completely
disabled because it is required for stable sorting.],
sort_algorithm="$withval", sort_algorithm="timsort")
GS_USE_TIMSORT=1
GS_USE_QUICKSORT=0
GS_USE_SHELLSORT=0
if test "$sort_algorithm" = "quicksort"; then
use_quicksort=1
else
if test "$srot_algorithm" = "shellsort"; then
use_shellsort=1
fi
fi
AC_SUBST(GS_USE_TIMSORT)
AC_SUBST(GS_USE_QUICKSORT)
AC_SUBST(GS_USE_SHELLSORT)
#--------------------------------------------------------------------
# Check whether nl_langinfo(CODESET) is supported, needed by Unicode.m.
#--------------------------------------------------------------------