Value of microeffiency (was: Re: Optimal ...)
T. William Wells
bill at proxftl.UUCP
Sun Jul 17 21:43:07 AEST 1988
In article <255 at chem.ucsd.EDU> tps at chem.ucsd.edu (Tom Stockfisch) writes:
> In article <472 at proxftl.UUCP> bill at proxftl.UUCP (T. William Wells) writes:
> >In article <4616 at b-tech.UUCP>, zeeff at b-tech.UUCP (Jon Zeeff) writes:
> >) In article <688 at clsib21.UUCP> ebg at clsib21.UUCP (Ed Gordon) writes:
> >) >>> [I wrote a much-faster clone of qsort() using linked-lists]
> > However, I might go ahead and
> >publish it. There is one minor gotcha: the drawback, not copied
> >in the message above, is that the routine has got to get memory
> >for the linked list.
>
> Rewrite your interface so that the user must supply the memory for
> the linked list and free it himself, so that if allocation/deallocation
> is an issue, the user can handle it.
That leads to a quandry: should I make it a qsort replacement or
not? If so, then this is not reasonable. If not, then it is
less useful.
Then again, I could write it with variable arguments and a global
control variable that determines whether it does the allocation
or whether the caller passes allocated memory.
And that requires conditional compilation for those
who do not want to pull in malloc.
Ugh!
Sigh.
More information about the Comp.lang.c
mailing list