This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

qsort documentation update



Jeremy mentioned in an reply to PR libc/1611:
}  On 28 Feb 2000, Andreas Jaeger wrote:
}  > The following patch has now been added to the development version of
}  > glibc 2.2.  What do you think of it?  It limits the memory to a
}  > quarter of the physical memory.
}  [snip]
}  
}  This is acceptable, but I think that the max allocation size could be
}  reduced even more.  As I mentioned in my previous message, merge sort
}  isn't actually a performance win if the extra memory requirement is
}  big enough.
}  
}  I know the standard doesn't require that qsort() be an in-place sort,
}  but the extra allocation is sufficiently "surprising" that it might be
}  worth mentioning in the libc documentation.  I can imagine that
}  someone building an embedded system will trip over this behavior in
}  the future.

I'm appending a patch for the documentation.  Is this ok?

Andreas


2000-05-15  Andreas Jaeger  <aj@suse.de>

	* manual/search.texi (Array Sort Function): Document that qsort is
	not necessarily in-place.

============================================================
Index: manual/search.texi
--- manual/search.texi	2000/03/10 08:40:34	1.30
+++ manual/search.texi	2000/05/15 13:08:52
@@ -183,6 +183,10 @@
 
 The @code{qsort} function derives its name from the fact that it was
 originally implemented using the ``quick sort'' algorithm.
+
+The implementation of @code{qsort} in this library might not be an
+in-place sort and might thereby use an extra amount of memory to store
+the array.
 @end deftypefun
 
 @node Search/Sort Example

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]