1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

Simplify malloc initialization

Singificantly reduce the code needed at malloc initialization.  In
the process getpagesize is simplified by always initializing
GLRO(dl_pagesize).
This commit is contained in:
Ulrich Drepper
2011-09-10 21:47:36 -04:00
parent 22a8918713
commit 02d46fc4b9
8 changed files with 65 additions and 98 deletions

View File

@ -28,26 +28,8 @@
int
__getpagesize ()
{
#ifdef __ASSUME_AT_PAGESIZE
assert (GLRO(dl_pagesize) != 0);
return GLRO(dl_pagesize);
#else
if (GLRO(dl_pagesize) != 0)
return GLRO(dl_pagesize);
# ifdef EXEC_PAGESIZE
return EXEC_PAGESIZE;
# else /* No EXEC_PAGESIZE. */
# ifdef NBPG
# ifndef CLSIZE
# define CLSIZE 1
# endif /* No CLSIZE. */
return NBPG * CLSIZE;
# else /* No NBPG. */
return NBPC;
# endif /* NBPG. */
# endif /* EXEC_PAGESIZE. */
#endif
}
libc_hidden_def (__getpagesize)
weak_alias (__getpagesize, getpagesize)