diff options
Diffstat (limited to 'malloc')
-rw-r--r-- | malloc/arena.c | 2 | ||||
-rw-r--r-- | malloc/hooks.c | 2 | ||||
-rw-r--r-- | malloc/malloc.c | 1 | ||||
-rw-r--r-- | malloc/memusagestat.c | 24 | ||||
-rw-r--r-- | malloc/morecore.c | 54 | ||||
-rw-r--r-- | malloc/tst-mallocfork.c | 3 |
6 files changed, 66 insertions, 20 deletions
diff --git a/malloc/arena.c b/malloc/arena.c index abbca1f02e..d0d223e94e 100644 --- a/malloc/arena.c +++ b/malloc/arena.c @@ -18,8 +18,6 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id$ */ - #include <stdbool.h> /* Compile-time constants. */ diff --git a/malloc/hooks.c b/malloc/hooks.c index 5dd2d65e62..708f0faf83 100644 --- a/malloc/hooks.c +++ b/malloc/hooks.c @@ -18,8 +18,6 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id$ */ - /* What to do if the standard debugging hooks are in place and a corrupt pointer is detected: do nothing (0), print an error message (1), or call abort() (2). */ diff --git a/malloc/malloc.c b/malloc/malloc.c index f9aa5b1226..7730963637 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -24,7 +24,6 @@ Doug Lea and adapted to multiple threads/arenas by Wolfram Gloger. * Version ptmalloc2-20011215 - $Id$ based on: VERSION 2.7.0 Sun Mar 11 14:14:06 2001 Doug Lea (dl at gee) diff --git a/malloc/memusagestat.c b/malloc/memusagestat.c index b1cad9b251..91e00af6d4 100644 --- a/malloc/memusagestat.c +++ b/malloc/memusagestat.c @@ -1,22 +1,20 @@ /* Generate graphic from memory profiling data. - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. - The GNU C Library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define _FILE_OFFSET_BITS 64 @@ -311,7 +309,7 @@ main (int argc, char *argv[]) (maxsize_heap / heap_scale); gdImageDashedLine (im_out, 40, ysize - 20 - cnt, xsize - 40, ysize - 20 - cnt, red); - snprintf (buf, sizeof (buf), heap_format, maxsize_heap / 4 * line / + snprintf (buf, sizeof (buf), heap_format, maxsize_heap / 4 * line / heap_scale); gdImageString (im_out, gdFontSmall, 39 - strlen (buf) * 6, ysize - 26 - cnt, buf, red); diff --git a/malloc/morecore.c b/malloc/morecore.c new file mode 100644 index 0000000000..0a66ef5a85 --- /dev/null +++ b/malloc/morecore.c @@ -0,0 +1,54 @@ +/* Copyright (C) 1991,92,93,94,95,97,2002,2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _MALLOC_INTERNAL +#define _MALLOC_INTERNAL +#include <malloc.h> +#endif + +#ifndef __GNU_LIBRARY__ +#define __sbrk sbrk +#endif + +#ifdef __GNU_LIBRARY__ +/* It is best not to declare this and cast its result on foreign operating + systems with potentially hostile include files. */ + +#include <stddef.h> +#include <stdlib.h> +extern __malloc_ptr_t __sbrk (ptrdiff_t increment) __THROW; +libc_hidden_proto (__sbrk) +#endif + +#ifndef NULL +#define NULL 0 +#endif + +/* Allocate INCREMENT more bytes of data space, + and return the start of data space, or NULL on errors. + If INCREMENT is negative, shrink data space. */ +__malloc_ptr_t +__default_morecore (increment) + __malloc_ptrdiff_t increment; +{ + __malloc_ptr_t result = (__malloc_ptr_t) __sbrk (increment); + if (result == (__malloc_ptr_t) -1) + return NULL; + return result; +} +libc_hidden_def (__default_morecore) diff --git a/malloc/tst-mallocfork.c b/malloc/tst-mallocfork.c index abbc9d83b6..f90ce94887 100644 --- a/malloc/tst-mallocfork.c +++ b/malloc/tst-mallocfork.c @@ -22,9 +22,8 @@ do_test (void) { pid_t parent = getpid (); - struct sigaction action; + struct sigaction action = { .sa_handler = sig_handler }; sigemptyset (&action.sa_mask); - action.sa_handler = sig_handler; malloc (sizeof (int)); |