millert
fe11de237e
Support swapping 32-bit aligned elements on 64-bit platforms.
Previously they would be swapped a byte at a time when sizeof(int)
!= sizeof(long). Idea from FreeBSD.
7 years ago
millert
e83742917d
Use David Musser's introsort algorithm to fall back to heapsort(3)
when the recursion depth reaches 2*lg(n + 1). This avoids quicksort's
quadratic behavior for pathological input without appreciably
changing the average run time.
7 years ago
millert
3791eca4cb
The BSD qsort() performs tail recursion elimination on the second
side of the array being partitioned to save on stack space. Greater
savings can be gained by choosing recursion for the smaller side
of the partition and eliminating recursion for the larger side.
This also results in a small but measurable performance gain.
OK otto@ schwarze@
7 years ago
millert
bf9b74c4ba
Remove unnecessary casts of 'a' to char * since 'a' is already char *.
This is a remnant from the original 4.4BSD code that had 'a' as
void * in the function args. No binary change. OK bluhm@
8 years ago
guenther
c8272cfe98
Wrap <stdlib.h> so that calls go direct and the symbols not in the
C standard are all weak.
Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the
arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.
9 years ago
millert
3c0d2bba38
Disable the "switch to insertion sort" optimization to avoid quadratic
behavior for certain inputs. From NetBSD. OK tedu@
10 years ago
otto
1fc05bec9f
Use size_t in appropriate places; fixes sorting of big arrays;
after the diff was written, I made it similar to the freebsd fix of
the same code; pr6287 ok millert@ guenther@
15 years ago
espie
b4fb9e2f94
zap remaining rcsid.
Kill old files that are no longer compiled.
okay theo
19 years ago
pat
4d0a547963
ansi + de-register
ok otto deraadt
20 years ago
millert
679cd5d050
Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.
22 years ago
millert
959b08f109
Manual cleanup of remaining userland __P use (excluding packages maintained outside the tree)
23 years ago
millert
b68c09e067
Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
23 years ago
deraadt
f7fc307897
typecastorama
28 years ago
tholo
fcedf08ffa
Fix RCS ids
Make sure everything uses {SYS,}LIBC_SCCS properly
29 years ago
tholo
352b163d5e
Cannot do operations on a void pointer
29 years ago
tholo
6ea1ec00cf
Add prototypes for internal functions
Change inline to __inline
29 years ago
deraadt
47b73ff83c
initial import of NetBSD tree
29 years ago