[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Using qsort(3) in the kernel
Andrew Doran wrote:
On Sun, Nov 16, 2008 at 03:38:24PM +0000, Matthias Scheler wrote:
On Sun, Nov 16, 2008 at 03:01:26PM +0000, Andrew Doran wrote:
Module Name: src
Committed By: ad
Date: Sun Nov 16 15:01:26 UTC 2008
src/sys/lib/libkern: Makefile libkern.h
Make qsort() available in libkern.
Our implementation of qsort() uses recursion. That is IMHO a dangerous
thing to do in the kernel.
Wow that is bad. I'll replace it with heapsort.
Thanks for letting me know.
Well, quicksort is recursive by definition. So that should not have been
a surprise for anyone.
However, it should use very little stack space for recursion, unless the
But I think a heapsort is better to use in places like a kernel anyway.
Main Index |
Thread Index |