diff options
Diffstat (limited to 'lib/malloc')
-rw-r--r-- | lib/malloc/Makefile.in | 24 | ||||
-rw-r--r-- | lib/malloc/getpagesize.h | 24 | ||||
-rw-r--r-- | lib/malloc/imalloc.h | 26 | ||||
-rw-r--r-- | lib/malloc/malloc.c | 32 | ||||
-rw-r--r-- | lib/malloc/mstats.h | 24 | ||||
-rw-r--r-- | lib/malloc/shmalloc.h | 28 | ||||
-rw-r--r-- | lib/malloc/stats.c | 26 | ||||
-rw-r--r-- | lib/malloc/stub.c | 22 | ||||
-rw-r--r-- | lib/malloc/table.c | 27 | ||||
-rw-r--r-- | lib/malloc/table.h | 28 | ||||
-rw-r--r-- | lib/malloc/trace.c | 27 | ||||
-rw-r--r-- | lib/malloc/watch.c | 39 | ||||
-rw-r--r-- | lib/malloc/watch.h | 28 | ||||
-rw-r--r-- | lib/malloc/xmalloc.c | 20 |
14 files changed, 193 insertions, 182 deletions
diff --git a/lib/malloc/Makefile.in b/lib/malloc/Makefile.in index b2c785b..e40f00a 100644 --- a/lib/malloc/Makefile.in +++ b/lib/malloc/Makefile.in @@ -1,21 +1,19 @@ # Skeleton Makefile for the GNU malloc code # -# -# Copyright (C) 1996-2005 Free Software Foundation, Inc. +# Copyright (C) 1996-2009 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, 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 as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. -# 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 General Public License for more details. +# 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 General Public License for more details. -# 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 USA. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. srcdir = @srcdir@ VPATH = .:@srcdir@ diff --git a/lib/malloc/getpagesize.h b/lib/malloc/getpagesize.h index 835f5da..7f32340 100644 --- a/lib/malloc/getpagesize.h +++ b/lib/malloc/getpagesize.h @@ -1,19 +1,21 @@ /* Emulation of getpagesize() for systems that need it. Copyright (C) 1991-2003 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This file is part of GNU Bash, the Bourne-Again SHell. -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 General Public License for more details. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. -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 USA. */ + Bash 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ #if defined (HAVE_UNISTD_H) # ifdef _MINIX diff --git a/lib/malloc/imalloc.h b/lib/malloc/imalloc.h index 72ba65a..34df10a 100644 --- a/lib/malloc/imalloc.h +++ b/lib/malloc/imalloc.h @@ -4,19 +4,19 @@ This file is part of GNU Bash, the Bourne Again SHell. - Bash is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2, or (at your option) any later - version. - - Bash 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License along - with Bash; see the file COPYING. If not, write to the Free Software - Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ /* Must be included *after* config.h */ diff --git a/lib/malloc/malloc.c b/lib/malloc/malloc.c index f9a08da..bca68e8 100644 --- a/lib/malloc/malloc.c +++ b/lib/malloc/malloc.c @@ -2,23 +2,21 @@ /* Copyright (C) 1985-2005 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - 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 General Public License for more details. + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - 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 USA. + Bash 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 General Public License for more details. -In other words, you are welcome to use, share and improve this program. -You are forbidden to forbid anyone else to use, share and improve -what you give them. Help stamp out software-hoarding! */ + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ /* * @(#)nmalloc.c 1 (Caltech) 2/21/82 @@ -231,7 +229,7 @@ static int maxbuck; /* highest bucket receiving allocation request. */ static char *memtop; /* top of heap */ -static unsigned long binsizes[NBUCKETS] = { +static const unsigned long binsizes[NBUCKETS] = { 8UL, 16UL, 32UL, 64UL, 128UL, 256UL, 512UL, 1024UL, 2048UL, 4096UL, 8192UL, 16384UL, 32768UL, 65536UL, 131072UL, 262144UL, 524288UL, 1048576UL, 2097152UL, 4194304UL, 8388608UL, 16777216UL, 33554432UL, @@ -312,7 +310,7 @@ xbotch (mem, e, s, file, line) int line; { fprintf (stderr, _("\r\nmalloc: %s:%d: assertion botched\r\n"), - file ? file : "unknown", line); + file ? file : _("unknown"), line); #ifdef MALLOC_REGISTER if (mem != NULL && malloc_register) mregister_describe_mem (mem, stderr); diff --git a/lib/malloc/mstats.h b/lib/malloc/mstats.h index 3153744..11389ff 100644 --- a/lib/malloc/mstats.h +++ b/lib/malloc/mstats.h @@ -2,19 +2,21 @@ /* Copyright (C) 2001-2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + This file is part of GNU Bash, the Bourne-Again SHell. - 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 General Public License for more details. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - 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 USA. */ + Bash 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ #ifndef _MSTATS_H #define _MSTATS_H diff --git a/lib/malloc/shmalloc.h b/lib/malloc/shmalloc.h index e51e92b..2dac615 100644 --- a/lib/malloc/shmalloc.h +++ b/lib/malloc/shmalloc.h @@ -2,19 +2,21 @@ tracking. */ /* Copyright (C) 2001-2003 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -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 General Public License for more details. - -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 USA. */ + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ #ifndef _SH_MALLOC_H #define _SH_MALLOC_H diff --git a/lib/malloc/stats.c b/lib/malloc/stats.c index 0d119fa..8665918 100644 --- a/lib/malloc/stats.c +++ b/lib/malloc/stats.c @@ -2,19 +2,21 @@ /* Copyright (C) 2001-2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + This file is part of GNU Bash, the Bourne-Again SHell. - 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 General Public License for more details. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - 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 USA. */ + Bash 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ #ifdef HAVE_CONFIG_H # include <config.h> @@ -181,7 +183,7 @@ _imalloc_fopen (s, fn, def, defbuf, defsiz) sprintf (pidbuf, "%ld", l); if ((strlen (pidbuf) + strlen (fn) + 2) >= sizeof (fname)) - return; + return ((FILE *)0); for (sp = 0, p = fname, q = fn; *q; ) { if (sp == 0 && *q == '%' && q[1] == 'p') diff --git a/lib/malloc/stub.c b/lib/malloc/stub.c index 770e3f9..a60a624 100644 --- a/lib/malloc/stub.c +++ b/lib/malloc/stub.c @@ -2,19 +2,19 @@ This file is part of GNU Bash, the Bourne Again SHell. - Bash is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2, or (at your option) any later - version. + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - Bash 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 General Public License - for more details. + Bash 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 General Public License for more details. - You should have received a copy of the GNU General Public License along - with Bash; see the file COPYING. If not, write to the Free Software - Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ void bash_malloc_stub() diff --git a/lib/malloc/table.c b/lib/malloc/table.c index b9310a6..cf89b3c 100644 --- a/lib/malloc/table.c +++ b/lib/malloc/table.c @@ -4,19 +4,20 @@ This file is part of GNU Bash, the Bourne Again SHell. - Bash is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2, or (at your option) any later - version. - - Bash 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License along - with Bash; see the file COPYING. If not, write to the Free Software - Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ + #ifdef HAVE_CONFIG_H # include <config.h> #endif diff --git a/lib/malloc/table.h b/lib/malloc/table.h index 0d22376..41ce9f7 100644 --- a/lib/malloc/table.h +++ b/lib/malloc/table.h @@ -2,19 +2,21 @@ /* Copyright (C) 2001-2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - 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 General Public License for more details. - - 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 USA. */ + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ #ifndef _MTABLE_H #define _MTABLE_H diff --git a/lib/malloc/trace.c b/lib/malloc/trace.c index 79f4668..6d93f99 100644 --- a/lib/malloc/trace.c +++ b/lib/malloc/trace.c @@ -4,19 +4,20 @@ This file is part of GNU Bash, the Bourne Again SHell. - Bash is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2, or (at your option) any later - version. - - Bash 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License along - with Bash; see the file COPYING. If not, write to the Free Software - Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ + #ifdef HAVE_CONFIG_H # include <config.h> #endif diff --git a/lib/malloc/watch.c b/lib/malloc/watch.c index 11ab744..00c8a82 100644 --- a/lib/malloc/watch.c +++ b/lib/malloc/watch.c @@ -4,19 +4,20 @@ This file is part of GNU Bash, the Bourne Again SHell. - Bash is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2, or (at your option) any later - version. - - Bash 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 General Public License - for more details. - - You should have received a copy of the GNU General Public License along - with Bash; see the file COPYING. If not, write to the Free Software - Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ + #ifdef HAVE_CONFIG_H # include <config.h> #endif @@ -43,17 +44,17 @@ watch_warn (addr, file, line, type, data) char *tag; if (type == W_ALLOC) - tag = _("allocated"); + tag = "allocated"; else if (type == W_FREE) - tag = _("freed"); + tag = "freed"; else if (type == W_REALLOC) - tag = _("requesting resize"); + tag = "requesting resize"; else if (type == W_RESIZED) - tag = _("just resized"); + tag = "just resized"; else - tag = _("bug: unknown operation"); + tag = "bug: unknown operation"; - fprintf (stderr, _("malloc: watch alert: %p %s "), addr, tag); + fprintf (stderr, "malloc: watch alert: %p %s ", addr, tag); if (data != (unsigned long)-1) fprintf (stderr, "(size %lu) ", data); fprintf (stderr, "from '%s:%d'\n", file ? file : "unknown", line); diff --git a/lib/malloc/watch.h b/lib/malloc/watch.h index 757bbd2..6782acc 100644 --- a/lib/malloc/watch.h +++ b/lib/malloc/watch.h @@ -2,19 +2,21 @@ /* Copyright (C) 2001-2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - 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 General Public License for more details. - - 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 USA. */ + This file is part of GNU Bash, the Bourne-Again SHell. + + Bash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Bash 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Bash. If not, see <http://www.gnu.org/licenses/>. +*/ #ifndef _MWATCH_H #define _MWATCH_H diff --git a/lib/malloc/xmalloc.c b/lib/malloc/xmalloc.c index ab7c91a..f6dec67 100644 --- a/lib/malloc/xmalloc.c +++ b/lib/malloc/xmalloc.c @@ -5,19 +5,19 @@ This file is part of GNU Readline, a library for reading lines of text with interactive input and history editing. - Readline is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. + Readline is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - Readline 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 - General Public License for more details. + Readline 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 General Public License for more details. You should have received a copy of the GNU General Public License - along with Readline; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + along with Readline. If not, see <http://www.gnu.org/licenses/>. +*/ #if defined (HAVE_CONFIG_H) #include <config.h> |