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:
@ -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)
|
||||
|
Reference in New Issue
Block a user