[Bug 135718] [patch] enhance qsort(3) to properly handle 32-bit aligned data on 64-bit systems

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Feb 6 23:57:45 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=135718

--- Comment #6 from Andrey A. Chernov <ache at FreeBSD.org> ---
What is must be done in machine independent code is really simple:

1)
#define SWAPINIT_long(a, es) swaptype_long = ...
#define SWAPINIT_int(a, es) swaptype_int = ...

2) Call both SWAPINITs instead of one.

3)
if (swaptype_long <= 1)
    swapcode(long, a, b, n)
else if (swaptype_int <= 1)
    swapcode(int, a, b, n)
else
    swapcode(char, a, b, n)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list