commit bash-20200605 snapshot

This commit is contained in:
Chet Ramey
2020-06-05 14:34:49 -04:00
parent 32ba27b400
commit ab309487d5
120 changed files with 812 additions and 811 deletions
+6 -6
View File
@@ -1,6 +1,6 @@
/* imalloc.h -- internal malloc definitions shared by source files. */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -67,11 +67,11 @@
# endif /* HAVE_BCOPY */
#endif /* !__GNUC__ */
#if !defined (__P)
#if !defined (PARAMS)
# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) || defined (PROTOTYPES)
# define __P(protos) protos
# define PARAMS(protos) protos
# else
# define __P(protos) ()
# define PARAMS(protos) ()
# endif
#endif
@@ -167,7 +167,7 @@ do { \
#include <signal.h>
extern void _malloc_block_signals __P((sigset_t *, sigset_t *));
extern void _malloc_unblock_signals __P((sigset_t *, sigset_t *));
extern void _malloc_block_signals PARAMS((sigset_t *, sigset_t *));
extern void _malloc_unblock_signals PARAMS((sigset_t *, sigset_t *));
#endif /* _IMALLOC_H */
+5 -5
View File
@@ -1,6 +1,6 @@
/* mstats.h - definitions for malloc statistics */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -104,10 +104,10 @@ struct bucket_stats {
int nmmap; /* currently unused */
};
extern struct bucket_stats malloc_bucket_stats __P((int));
extern struct _malstats malloc_stats __P((void));
extern void print_malloc_stats __P((char *));
extern void trace_malloc_stats __P((char *, char *));
extern struct bucket_stats malloc_bucket_stats PARAMS((int));
extern struct _malstats malloc_stats PARAMS((void));
extern void print_malloc_stats PARAMS((char *));
extern void trace_malloc_stats PARAMS((char *, char *));
#endif /* MALLOC_STATS */
+18 -18
View File
@@ -1,6 +1,6 @@
/* Functions (currently) for use by the shell to do malloc debugging and
tracking. */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -21,11 +21,11 @@
#ifndef _SH_MALLOC_H
#define _SH_MALLOC_H
#ifndef __P
#ifndef PARAMS
# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
# define __P(protos) protos
# define PARAMS(protos) protos
# else
# define __P(protos) ()
# define PARAMS(protos) ()
# endif
#endif
@@ -41,30 +41,30 @@
#endif /* PTR_T */
extern PTR_T sh_malloc __P((size_t, const char *, int));
extern PTR_T sh_realloc __P((PTR_T, size_t, const char *, int));
extern void sh_free __P((PTR_T, const char *, int));
extern PTR_T sh_malloc PARAMS((size_t, const char *, int));
extern PTR_T sh_realloc PARAMS((PTR_T, size_t, const char *, int));
extern void sh_free PARAMS((PTR_T, const char *, int));
extern PTR_T sh_memalign __P((size_t, size_t, const char *, int));
extern PTR_T sh_memalign PARAMS((size_t, size_t, const char *, int));
extern PTR_T sh_calloc __P((size_t, size_t, const char *, int));
extern void sh_cfree __P((PTR_T, const char *, int));
extern PTR_T sh_calloc PARAMS((size_t, size_t, const char *, int));
extern void sh_cfree PARAMS((PTR_T, const char *, int));
extern PTR_T sh_valloc __P((size_t, const char *, int));
extern PTR_T sh_valloc PARAMS((size_t, const char *, int));
/* trace.c */
extern int malloc_set_trace __P((int));
extern int malloc_set_trace PARAMS((int));
extern void malloc_set_tracefp (); /* full prototype requires stdio.h */
extern void malloc_set_tracefn __P((char *, char *));
extern void malloc_set_tracefn PARAMS((char *, char *));
/* table.c */
extern void mregister_dump_table __P((void));
extern void mregister_table_init __P((void));
extern int malloc_set_register __P((int));
extern void mregister_dump_table PARAMS((void));
extern void mregister_table_init PARAMS((void));
extern int malloc_set_register PARAMS((int));
/* stats.c */
extern void print_malloc_stats __P((char *));
extern void print_malloc_stats PARAMS((char *));
extern void fprint_malloc_stats (); /* full prototype requires stdio.h */
extern void trace_malloc_stats __P((char *, char *));
extern void trace_malloc_stats PARAMS((char *, char *));
#endif
+3 -3
View File
@@ -1,6 +1,6 @@
/* stats.c - malloc statistics */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -34,13 +34,13 @@
#include "mstats.h"
extern int malloc_free_blocks __P((int));
extern int malloc_free_blocks PARAMS((int));
extern int malloc_mmap_threshold;
extern struct _malstats _mstats;
extern FILE *_imalloc_fopen __P((char *, char *, char *, char *, size_t));
extern FILE *_imalloc_fopen PARAMS((char *, char *, char *, char *, size_t));
struct bucket_stats
malloc_bucket_stats (size)
+3 -3
View File
@@ -1,6 +1,6 @@
/* table.c - bookkeeping functions for allocated memory */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -30,14 +30,14 @@
#ifdef SHELL
extern int interrupt_immediately, running_trap;
extern int signal_is_trapped __P((int));
extern int signal_is_trapped PARAMS((int));
#endif
extern int malloc_register;
#ifdef MALLOC_REGISTER
extern FILE *_imalloc_fopen __P((char *, char *, char *, char *, size_t));
extern FILE *_imalloc_fopen PARAMS((char *, char *, char *, char *, size_t));
#define FIND_ALLOC 0x01 /* find slot for new allocation */
#define FIND_EXIST 0x02 /* find slot for existing entry for free() or search */
+10 -10
View File
@@ -1,6 +1,6 @@
/* table.h - definitions for tables for keeping track of allocated memory */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -57,12 +57,12 @@ typedef struct mr_table {
#define REG_TABLE_SIZE 8192
extern mr_table_t *mr_table_entry __P((PTR_T));
extern void mregister_alloc __P((const char *, PTR_T, size_t, const char *, int));
extern void mregister_free __P((PTR_T, int, const char *, int));
extern mr_table_t *mr_table_entry PARAMS((PTR_T));
extern void mregister_alloc PARAMS((const char *, PTR_T, size_t, const char *, int));
extern void mregister_free PARAMS((PTR_T, int, const char *, int));
extern void mregister_describe_mem ();
extern void mregister_dump_table __P((void));
extern void mregister_table_init __P((void));
extern void mregister_dump_table PARAMS((void));
extern void mregister_table_init PARAMS((void));
typedef struct ma_table {
const char *file;
@@ -70,10 +70,10 @@ typedef struct ma_table {
int nalloc;
} ma_table_t;
extern void mlocation_register_alloc __P((const char *, int));
extern void mlocation_table_init __P((void));
extern void mlocation_dump_table __P((void));
extern void mlocation_write_table __P((void));
extern void mlocation_register_alloc PARAMS((const char *, int));
extern void mlocation_table_init PARAMS((void));
extern void mlocation_dump_table PARAMS((void));
extern void mlocation_write_table PARAMS((void));
/* NOTE: HASH_MIX taken from dmalloc (http://dmalloc.com) */
+2 -2
View File
@@ -1,6 +1,6 @@
/* trace.c - tracing functions for malloc */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -35,7 +35,7 @@ static int _mtrace_verbose = 0;
#ifdef MALLOC_TRACE
extern FILE *_imalloc_fopen __P((char *, char *, char *, char *, size_t));
extern FILE *_imalloc_fopen PARAMS((char *, char *, char *, char *, size_t));
FILE *_mtrace_fp = NULL;
extern char _malloc_trace_buckets[];
+2 -2
View File
@@ -1,6 +1,6 @@
/* watch.h - definitions for tables for keeping track of allocated memory */
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne-Again SHell.
@@ -34,7 +34,7 @@
extern int _malloc_nwatch;
extern void _malloc_ckwatch __P((PTR_T, const char *, int, int, unsigned long));
extern void _malloc_ckwatch PARAMS((PTR_T, const char *, int, int, unsigned long));
#endif /* MALLOC_WATCH */