freebsd-dev/lib/libc/stdlib
Marcel Moolenaar fd7707aa50 Do not adjust to the pagesize at runtime. Besides for the one-time
initialization overhead, there's a problem in that we never call
imalloc() and thus malloc_init() for zero-sized allocations. As a
result, malloc(0) returns NULL when it's the first or only malloc in
the program. Any non-zero allocation will initialize the malloc code
with the side-effect that subsequent zero-sized allocations return a
non-NULL pointer. This is because the pointer we return for zero-
sized allocations is calculated from malloc_pageshift, which needs
to be initialized at runtime on ia64.

The result of the inconsistent behaviour described above is that
configure scripts failed the test for a GNU compatible malloc. This
resulted in a lot of broken ports.

Other, even simpler, solutions were possible as well:
1.  initialize malloc_pageshift with some non-zero value (say 13 for
    8KB pages) and keep the runtime adjustment.
2.  Stop using malloc_pageshift to calculate ZEROSIZEPTR.

Removal of the runtime adjustment was chosen because then ia64 is the
same as any other platform. It is not to say that using a page size
obtained at runtime is bad per se. It's that there's currently a high
level of gratuity for its existence and the moment it causes problems
is the moment you need to get rid of it. Hence, it's not unthinkable
that this commit is (partially) reverted some time in the future when
we do have a good reason for it and a good way to achieve it.

Approved by: re@ (rwatson)
Reported by: kris (portmgr@) -- may the ports be with you
2003-11-28 18:03:22 +00:00
..
_Exit.c Implement C99's _Exit() interface. 2002-09-10 02:04:49 +00:00
abort.3 Detail thread-safe and async-cancel-safe status. 2001-09-09 18:52:00 +00:00
abort.c Replace some syscalls with libc version, this makes abort work better with 2003-08-16 11:43:57 +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 Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
atexit.h Fix the style of the SCM ID's. 2002-03-22 23:42:05 +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 Fix the style of the SCM ID's. 2002-03-22 21:53:29 +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
calloc.c Nonexistent SIZE_MAX -> SIZE_T_MAX 2002-08-04 04:11:48 +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 Get rid of duplicates. 2003-09-14 13:41:59 +00:00
exit.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
getenv.3 mdoc(7) police: Fixed abuses of the .Ar and .Em macros. 2002-12-18 13:33:04 +00:00
getenv.c Remove __P() usage. 2002-03-21 22:49:10 +00:00
getopt_long.3 mdoc(7) police: "The .Fn function". 2002-12-18 12:45:11 +00:00
getopt_long.c de-__P() 2002-10-16 22:18:42 +00:00
getopt.3 mdoc(7): Properly mark C headers. 2003-09-10 19:24:35 +00:00
getopt.c Do not use __progname directly (except in [gs]etprogname(3)). 2002-03-29 22:43:43 +00:00
getsubopt.3 Move to using .In instead of .Fd #include <> for include mark-up. 2001-09-07 14:46:36 +00:00
getsubopt.c #include <string.h> for strcmp()'s prototype. 2003-01-03 23:31:50 +00:00
grantpt.3 Get rid of duplicates. 2003-09-14 13:41:59 +00:00
grantpt.c Fix three warnings: 2003-01-04 08:10:55 +00:00
hcreate.3 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +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
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 mdoc(7) police: "The .Fa argument.". 2002-12-19 09:40:28 +00:00
lsearch.c - Remove the lsearch() and lfind() functions and their manpage from 2002-10-16 14:29:23 +00:00
Makefile.inc Don peril sensitive (ie: bikeshed sensitive) sunglasses and quietly 2003-10-28 22:36:54 +00:00
malloc.3 mdoc(7) police: Deal with self-xrefs. 2002-12-24 13:41:48 +00:00
malloc.c Do not adjust to the pagesize at runtime. Besides for the one-time 2003-11-28 18:03:22 +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 Remove __P() usage. 2002-03-21 22:49:10 +00:00
putenv.c Fix the style of the SCM ID's. 2002-03-22 21:53:29 +00:00
qsort_r.c Implement C99's _Exit() interface. 2002-09-10 02:04:49 +00:00
qsort.3 Cite the published version of "Engineering a Sort Function" instead of 2003-09-30 07:05:46 +00:00
qsort.c Implement C99's _Exit() interface. 2002-09-10 02:04:49 +00:00
radixsort.3 Move to using .In instead of .Fd #include <> for include mark-up. 2001-09-07 14:46:36 +00:00
radixsort.c Improve the performance of radixsort() when 2003-11-11 04:59:23 +00:00
rand.3 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +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 Cross-reference arc4random(3). 2003-07-31 06:18:34 +00:00
random.c For type 0 rng lower initial drop to 50, it is enough to hide linearity 2003-08-10 17:49:55 +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 According to C99 decimal_point can't be empty 2003-03-20 08:18:55 +00:00
strtod.3 Assorted mdoc(7) fixes. 2003-05-22 13:02:28 +00:00
strtoimax.c Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup, 2003-01-01 18:49:04 +00:00
strtol.3 Add cross-references to wide character versions of these functions. 2002-10-10 04:31:57 +00:00
strtol.c Style: One space between "restrict" qualifier and "*". 2002-09-06 11:24:06 +00:00
strtoll.c Style: One space between "restrict" qualifier and "*". 2002-09-06 11:24:06 +00:00
strtoq.c - Add the 'restrict' qualifier to the function prototypes and 2002-08-15 09:25:04 +00:00
strtoul.3 Add cross-references to wide character versions of these functions. 2002-10-10 04:31:57 +00:00
strtoul.c Style: One space between "restrict" qualifier and "*". 2002-09-06 11:24:06 +00:00
strtoull.c Style: One space between "restrict" qualifier and "*". 2002-09-06 11:24:06 +00:00
strtoumax.c Style: One space between "restrict" qualifier and "*". 2002-09-06 11:24:06 +00:00
strtouq.c - Add the 'restrict' qualifier to the function prototypes and 2002-08-15 09:25: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 mdoc(7) police: "The .Fa argument.". 2002-12-19 09:40:28 +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