opnsense-src/lib/libc/stdlib
Jason Evans 5355c74026 Use some math tricks in arena_run_reg_dalloc() to avoid actual division, as
well as avoiding a switch statement.  This change has no significant impact
to performance when branch prediction is successful at predicting the sizes
of objects passed to free(), but in the case that the object sizes are
semi-random, this change has the potential to prevent many branch prediction
misses, thus improving performance substantially.

Take advantage of alignment guarantees in ipalloc(), and pad object sizes to
something less than a power of two when possible.  This has the potential
to substantially reduce internal fragmentation for objects allocated via
posix_memalign().

Avoid an unnecessary pow2_ceil() call in arena_ralloc().

Submitted by:	djam8193ah@hotmail.com
2006-07-01 16:51:10 +00:00
..
_Exit.c Implement C99's _Exit() interface. 2002-09-10 02:04:49 +00:00
a64l.3 Fix typo in manual page reference. 2006-02-26 23:01:11 +00:00
a64l.c Correct decoding a string containing '/'. 2006-05-19 19:06:38 +00:00
abort.3 Detail thread-safe and async-cancel-safe status. 2001-09-09 18:52:00 +00:00
abort.c Move the declaration of __cleanup to libc_private.h as it is used in both 2005-09-12 13:46:32 +00:00
abs.3 mdoc(7) police: Fixed abuses of the .Ar and .Em macros. 2002-12-18 13:33:04 +00:00
abs.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
alloca.3 mdoc(7) fix: Use the normal AT&T macro (.At) rather than its 2003-06-28 22:12:30 +00:00
atexit.3 mdoc(7) police: Fixed abuses of the .Ar and .Em macros. 2002-12-18 13:33:04 +00:00
atexit.c Implement __cxa_atexit/__cxa_finalize as specified by the cross-vendor 2003-12-19 17:11:20 +00:00
atexit.h Implement __cxa_atexit/__cxa_finalize as specified by the cross-vendor 2003-12-19 17:11:21 +00:00
atof.3 mdoc(7) police: Fixed abuses of the .Ar and .Em macros. 2002-12-18 13:33:04 +00:00
atof.c style cleanup: Remove duplicate $FreeBSD$ tags. 2004-02-10 20:42:33 +00:00
atoi.3 mdoc(7) police: Fixed abuses of the .Ar and .Em macros. 2002-12-18 13:33:04 +00:00
atoi.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
atol.3 mdoc(7) police: add missing markup bits for ``errno''. 2002-01-09 14:03:54 +00:00
atol.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
atoll.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
bsearch.3 Move to using .In instead of .Fd #include <> for include mark-up. 2001-09-07 14:46:36 +00:00
bsearch.c Remove __P() usage. 2002-03-21 22:49:10 +00:00
div.3 mdoc(7) police: Fixed abuses of the .Ar and .Em macros. 2002-12-18 13:33:04 +00:00
div.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
exit.3 Sort SEE ALSO references (in dictionary order, ignoring case). 2004-07-04 20:55:50 +00:00
exit.c Move the declaration of __cleanup to libc_private.h as it is used in both 2005-09-12 13:46:32 +00:00
getenv.3 Sort sections. 2005-01-20 09:17:07 +00:00
getenv.c Remove __P() usage. 2002-03-21 22:49:10 +00:00
getopt.3 Use #include <unistd.h> rather than the explicit externs in the 2004-07-31 01:00:50 +00:00
getopt.c Merge some fixes from NetBSD's getopt.c v1.26: 2004-03-06 17:05:45 +00:00
getopt_long.3 Sort sections. 2005-01-20 09:17:07 +00:00
getopt_long.c Keep it sync with OpenBSD: 2004-07-06 13:58:45 +00:00
getsubopt.3 POSIX clearly states that getsubopt() should be declared in <stdlib.h> 2004-02-23 03:32:10 +00:00
getsubopt.c Remove unneccessary <unistd.h> 2004-02-23 03:30:02 +00:00
grantpt.3 Get rid of duplicates. 2003-09-14 13:41:59 +00:00
grantpt.c Remove extra slash from pty slave device name returned by ptsname. 2006-02-13 00:04:04 +00:00
hcreate.3 Sort sections. 2005-01-20 09:17:07 +00:00
hcreate.c Remove improper use of <namespace.h> 2002-06-27 13:18:27 +00:00
heapsort.c Remove __P() usage. 2002-03-21 22:49:10 +00:00
imaxabs.3 mdoc(7) police: fixed typos and minor markup nits. 2001-11-21 16:19:50 +00:00
imaxabs.c o Implement imaxabs(), imaxdiv(), llabs(), lldiv(). 2001-11-15 02:05:03 +00:00
imaxdiv.3 mdoc(7) police: fixed typos and minor markup nits. 2001-11-21 16:19:50 +00:00
imaxdiv.c o Implement imaxabs(), imaxdiv(), llabs(), lldiv(). 2001-11-15 02:05:03 +00:00
insque.3 Fix typo. 2003-02-25 21:59:36 +00:00
insque.c style(9): return type on separate line from function name. 2003-01-04 07:34:41 +00:00
l64a.c Add a64l(), l64a(), and l64a_r() XSI extentions. These functions convert 2005-12-24 22:37:59 +00:00
labs.3 mdoc(7) police: Fixed abuses of the .Ar and .Em macros. 2002-12-18 13:33:04 +00:00
labs.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
ldiv.3 mdoc(7) police: Fixed abuses of the .Ar and .Em macros. 2002-12-18 13:33:04 +00:00
ldiv.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
llabs.3 mdoc(7) police: fixed typos and minor markup nits. 2001-11-21 16:19:50 +00:00
llabs.c o Implement imaxabs(), imaxdiv(), llabs(), lldiv(). 2001-11-15 02:05:03 +00:00
lldiv.3 mdoc(7) police: fixed typos and minor markup nits. 2001-11-21 16:19:50 +00:00
lldiv.c o Implement imaxabs(), imaxdiv(), llabs(), lldiv(). 2001-11-15 02:05:03 +00:00
lsearch.3 Sort sections. 2005-01-20 09:17:07 +00:00
lsearch.c - Remove the lsearch() and lfind() functions and their manpage from 2002-10-16 14:29:23 +00:00
Makefile.inc Add malloc_usable_size(3). 2006-03-28 22:16:04 +00:00
malloc.3 s/soley/solely 2006-04-13 18:19:44 +00:00
malloc.c Use some math tricks in arena_run_reg_dalloc() to avoid actual division, as 2006-07-01 16:51:10 +00:00
memory.3 Move to using .In instead of .Fd #include <> for include mark-up. 2001-09-07 14:46:36 +00:00
merge.c Fix some signed/unsigned comparisons. Fix prototypes while I'm here. 2005-01-12 03:39:34 +00:00
posix_memalign.3 In preparation for a new malloc implementation: 2006-01-12 07:28:21 +00:00
putenv.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
qsort.3 Sort sections. 2005-01-20 09:17:07 +00:00
qsort.c Implement C99's _Exit() interface. 2002-09-10 02:04:49 +00:00
qsort_r.c Implement C99's _Exit() interface. 2002-09-10 02:04:49 +00:00
radixsort.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
radixsort.c Improve the performance of radixsort() when 2003-11-11 04:59:23 +00:00
rand.3 sranddev() is not magic pixie dust. While it gives a good random 2004-11-10 17:25:49 +00:00
rand.c Back out "drop first N values" method of removing monotonically increased 2003-02-17 03:52:35 +00:00
random.3 Sort sections. 2005-01-20 09:17:07 +00:00
random.c Use 'uint32_t' instead of 'long' when a 32-bit integer is intended. 2004-01-20 03:02:18 +00:00
reallocf.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
realpath.3 Make realpath() thread-safe. New implementation does not use chdir(2) at all. 2003-03-27 20:48:53 +00:00
realpath.c Fix stripping last path component when only one path component left. 2003-05-28 08:23:01 +00:00
remque.c style(9): return type on separate line from function name. 2003-01-04 07:34:41 +00:00
setenv.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
strfmon.3 strfmon(3) does not correctly handle multibyte characters in the 2003-01-06 06:21:25 +00:00
strfmon.c Include a couple of headers to ensure consistency between the prototype and 2005-09-12 19:52:42 +00:00
strtod.3 Sort sections. 2005-01-20 09:17:07 +00:00
strtoimax.c Whitespace/style tweaking of prev. commit. 2005-01-21 13:31:02 +00:00
strtol.3 o .Xr strtonum(3). 2006-05-20 21:11:35 +00:00
strtol.c Whitespace/style tweaking of prev. commit. 2005-01-21 13:31:02 +00:00
strtoll.c Whitespace/style tweaking of prev. commit. 2005-01-21 13:31:02 +00:00
strtonum.3 Add a non-optional newline after ".Bx". 2006-03-15 14:45:45 +00:00
strtonum.c POSIXed strtoll() (and ours one too) can set errno to EINVAL, so check 2006-03-14 19:53:03 +00:00
strtoq.c - Add the 'restrict' qualifier to the function prototypes and 2002-08-15 09:25:04 +00:00
strtoul.3 o .Xr strtonum(3). 2006-05-20 21:11:35 +00:00
strtoul.c Whitespace/style tweaking of prev. commit. 2005-01-21 13:31:02 +00:00
strtoull.c Whitespace/style tweaking of prev. commit. 2005-01-21 13:31:02 +00:00
strtoumax.c Whitespace/style tweaking of prev. commit. 2005-01-21 13:31:02 +00:00
strtouq.c - Add the 'restrict' qualifier to the function prototypes and 2002-08-15 09:25:04 +00:00
Symbol.map Add malloc_usable_size(3). 2006-03-28 22:16:04 +00:00
system.3 Remove spurious period. 2002-05-27 03:45:27 +00:00
system.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
tdelete.c No need to include <assert.h> here. 2003-01-05 02:43:18 +00:00
tfind.c No need to include <assert.h> here. 2003-01-05 02:43:18 +00:00
tsearch.3 twalk() expects an `action' function not a comparison function. 2006-06-23 13:36:33 +00:00
tsearch.c No need to include <assert.h> here. 2003-01-05 02:43:18 +00:00
twalk.c No need to include <assert.h> here. 2003-01-05 02:43:18 +00:00