This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.12-113-gb9b42ee


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  b9b42ee01c935133c025d3b20102c1e490354e8e (commit)
      from  004c737f7b097026c4231fbc3644e9450f9e087e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b9b42ee01c935133c025d3b20102c1e490354e8e

commit b9b42ee01c935133c025d3b20102c1e490354e8e
Author: Anton Blanchard <anton@samba.org>
Date:   Mon Aug 16 23:06:55 2010 -0700

    Replace divide and multiply with mask in sYSTRIm

diff --git a/ChangeLog b/ChangeLog
index c935b53..af67e35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-26  Anton Blanchard  <anton@samba.org>
+
+	* malloc/malloc.c (sYSTRIm): Replace divide and multiply with mask.
+	* malloc/arena.c (heap_trim): Likewise.
+
 2010-08-16  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/unix/sysv/linux/syscalls.list: Add entry for fanotify_init
diff --git a/malloc/arena.c b/malloc/arena.c
index 4d0deef..59e96db 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -1,5 +1,5 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2009
+   Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2009,2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@malloc.de>, 2001.
@@ -206,7 +206,7 @@ malloc_atfork(size_t sz, const Void_t *caller)
       return _int_malloc(&main_arena, sz);
     } else {
       if(top_check()<0)
-        return 0;
+	return 0;
       victim = _int_malloc(&main_arena, sz+1);
       return mem2mem_check(victim, sz);
     }
@@ -633,7 +633,7 @@ ptmalloc_init (void)
 /* There are platforms (e.g. Hurd) with a link-time hook mechanism. */
 #ifdef thread_atfork_static
 thread_atfork_static(ptmalloc_lock_all, ptmalloc_unlock_all, \
-                     ptmalloc_unlock_all2)
+		     ptmalloc_unlock_all2)
 #endif
 
 
@@ -660,7 +660,7 @@ dump_heap(heap) heap_info *heap;
   ptr = (heap->ar_ptr != (mstate)(heap+1)) ?
     (char*)(heap + 1) : (char*)(heap + 1) + sizeof(struct malloc_state);
   p = (mchunkptr)(((unsigned long)ptr + MALLOC_ALIGN_MASK) &
-                  ~MALLOC_ALIGN_MASK);
+		  ~MALLOC_ALIGN_MASK);
   for(;;) {
     fprintf(stderr, "chunk %p size %10lx", p, (long)p->size);
     if(p == top(heap->ar_ptr)) {
@@ -879,7 +879,7 @@ heap_trim(heap, pad) heap_info *heap; size_t pad;
     /*check_chunk(ar_ptr, top_chunk);*/
   }
   top_size = chunksize(top_chunk);
-  extra = ((top_size - pad - MINSIZE + (pagesz-1))/pagesz - 1) * pagesz;
+  extra = (top_size - pad - MINSIZE - 1) & ~(pagesz - 1);
   if(extra < (long)pagesz)
     return 0;
   /* Try to shrink. */
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 9594be4..53ee1cc 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -3466,7 +3466,7 @@ static int sYSTRIm(pad, av) size_t pad; mstate av;
   top_size = chunksize(av->top);
 
   /* Release in pagesize units, keeping at least one page */
-  extra = ((top_size - pad - MINSIZE + (pagesz-1)) / pagesz - 1) * pagesz;
+  extra = (top_size - pad - MINSIZE - 1) & ~(pagesz - 1);
 
   if (extra > 0) {
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog       |    5 +++++
 malloc/arena.c  |   10 +++++-----
 malloc/malloc.c |    2 +-
 3 files changed, 11 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]