tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: qsort_r



On Sun, Dec 08, 2013 at 11:44:28PM +0100, Joerg Sonnenberger wrote:
> On Sun, Dec 08, 2013 at 10:29:53PM +0000, David Holland wrote:
> > I have done it by having the original, non-_r functions provide a
> > thunk for the comparison function, as this is least invasive. If we
> > think this is too expensive, an alternative is generating a union of
> > function pointers and making tests at the call sites; another option
> > is to duplicate the code (hopefully with cpp rather than C&P) but that
> > seems like a bad plan.
> 
> I'd prefer to not have another indirect call. The only difference
> is the definition and expanding a CMP macro differently?

Is just casting the function pointers safe in C (well in NetBSD)?
(with the calling conventions that Unix effectively requires)

Can anything slightly less nasty be done with varags functions?

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index