diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-01-17 10:42:43 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-01-17 10:42:43 +0000 |
commit | af98d46f5a025ae33c60ddb1a5edc753fb714bc5 (patch) | |
tree | 24a3c5cb0bfc6163b52ae74ac205f0e175beee87 /malloc | |
parent | 1f09da09fed864c91288ff91295114fa5202edaa (diff) |
Updated to fedora-glibc-20070117T0857
Diffstat (limited to 'malloc')
-rw-r--r-- | malloc/malloc.c | 22 | ||||
-rwxr-xr-x | malloc/memusage.sh | 4 | ||||
-rw-r--r-- | malloc/mtrace.pl | 4 |
3 files changed, 22 insertions, 8 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index d15ed57bd7..6427608a79 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -2896,7 +2896,13 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av; is one SIZE_SZ unit larger than for normal chunks, because there is no following chunk whose prev_size field could be used. */ +#if 1 + /* See the front_misalign handling below, for glibc there is no + need for further alignments. */ + size = (nb + SIZE_SZ + pagemask) & ~pagemask; +#else size = (nb + SIZE_SZ + MALLOC_ALIGN_MASK + pagemask) & ~pagemask; +#endif tried_mmap = true; /* Don't try if size wraps around 0 */ @@ -2914,6 +2920,12 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av; address argument for later munmap in free() and realloc(). */ +#if 1 + /* For glibc, chunk2mem increases the address by 2*SIZE_SZ and + MALLOC_ALIGN_MASK is 2*SIZE_SZ-1. Each mmap'ed area is page + aligned and therefore definitely MALLOC_ALIGN_MASK-aligned. */ + assert (((INTERNAL_SIZE_T)chunk2mem(mm) & MALLOC_ALIGN_MASK) == 0); +#else front_misalign = (INTERNAL_SIZE_T)chunk2mem(mm) & MALLOC_ALIGN_MASK; if (front_misalign > 0) { correction = MALLOC_ALIGNMENT - front_misalign; @@ -2921,10 +2933,12 @@ static Void_t* sYSMALLOc(nb, av) INTERNAL_SIZE_T nb; mstate av; p->prev_size = correction; set_head(p, (size - correction) |IS_MMAPPED); } - else { - p = (mchunkptr)mm; - set_head(p, size|IS_MMAPPED); - } + else +#endif + { + p = (mchunkptr)mm; + set_head(p, size|IS_MMAPPED); + } /* update statistics */ diff --git a/malloc/memusage.sh b/malloc/memusage.sh index ad833523f2..67af4998ca 100755 --- a/malloc/memusage.sh +++ b/malloc/memusage.sh @@ -1,5 +1,5 @@ #! @BASH@ -# Copyright (C) 1999-2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 1999-2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This file is part of the GNU C Library. # Contributed by Ulrich Drepper <drepper@gnu.org>, 1999. @@ -71,7 +71,7 @@ do_version() { printf $"Copyright (C) %s Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -" "2006" +" "2007" printf $"Written by %s. " "Ulrich Drepper" exit 0 diff --git a/malloc/mtrace.pl b/malloc/mtrace.pl index 8a0fbc7e95..280b469d92 100644 --- a/malloc/mtrace.pl +++ b/malloc/mtrace.pl @@ -1,7 +1,7 @@ #! @PERL@ eval "exec @PERL@ -S $0 $*" if 0; -# Copyright (C) 1997-2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 1997-2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This file is part of the GNU C Library. # Contributed by Ulrich Drepper <drepper@gnu.org>, 1997. # Based on the mtrace.awk script. @@ -45,7 +45,7 @@ arglist: while (@ARGV) { $ARGV[0] eq "--vers" || $ARGV[0] eq "--versi" || $ARGV[0] eq "--versio" || $ARGV[0] eq "--version") { print "mtrace (GNU $PACKAGE) $VERSION\n"; - print "Copyright (C) 2006 Free Software Foundation, Inc.\n"; + print "Copyright (C) 2007 Free Software Foundation, Inc.\n"; print "This is free software; see the source for copying conditions. There is NO\n"; print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"; print "Written by Ulrich Drepper <drepper\@gnu.org>\n"; |