about summary refs log tree commit diff
path: root/malloc/hooks.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-09-10 21:47:36 -0400
committerUlrich Drepper <drepper@gmail.com>2011-09-10 21:47:36 -0400
commit02d46fc4b969e25e4ba0c54aa95fa98d7279bd05 (patch)
tree8d0fc5bfaeac42091551da91a1f992ff656f1f56 /malloc/hooks.c
parent22a89187139a9083ca73989bfd11597e0f85cb61 (diff)
downloadglibc-02d46fc4b969e25e4ba0c54aa95fa98d7279bd05.tar.gz
glibc-02d46fc4b969e25e4ba0c54aa95fa98d7279bd05.tar.xz
glibc-02d46fc4b969e25e4ba0c54aa95fa98d7279bd05.zip
Simplify malloc initialization
Singificantly reduce the code needed at malloc initialization.  In
the process getpagesize is simplified by always initializing
GLRO(dl_pagesize).
Diffstat (limited to 'malloc/hooks.c')
-rw-r--r--malloc/hooks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/malloc/hooks.c b/malloc/hooks.c
index a0793a6316..7817ae9d4a 100644
--- a/malloc/hooks.c
+++ b/malloc/hooks.c
@@ -147,7 +147,7 @@ mem2chunk_check(void* mem, unsigned char **magic_p)
       if(c<=0 || sz<(c+2*SIZE_SZ)) return NULL;
     }
   } else {
-    unsigned long offset, page_mask = malloc_getpagesize-1;
+    unsigned long offset, page_mask = GLRO(dl_pagesize)-1;
 
     /* mmap()ed chunks have MALLOC_ALIGNMENT or higher power-of-two
        alignment relative to the beginning of a page.  Check this
@@ -182,7 +182,7 @@ top_check(void)
   mchunkptr t = top(&main_arena);
   char* brk, * new_brk;
   INTERNAL_SIZE_T front_misalign, sbrk_size;
-  unsigned long pagesz = malloc_getpagesize;
+  unsigned long pagesz = GLRO(dl_pagesize);
 
   if (t == initial_top(&main_arena) ||
       (!chunk_is_mmapped(t) &&