Imported from ../bash-3.0.tar.gz.

This commit is contained in:
Jari Aalto 2004-07-27 13:29:18 +00:00
commit b80f6443b6
400 changed files with 69247 additions and 13346 deletions

View file

@ -1,6 +1,6 @@
/* trace.c - tracing functions for malloc */
/* Copyright (C) 2001 Free Software Foundation, Inc.
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -29,6 +29,8 @@ extern int malloc_trace;
static int _mtrace_verbose = 0;
extern FILE *_imalloc_fopen __P((char *, char *, char *, char *, size_t));
#ifdef MALLOC_TRACE
FILE *_mtrace_fp = NULL;
@ -101,3 +103,20 @@ malloc_trace_bin (n)
_malloc_trace_buckets[n] = 1;
#endif
}
#define TRACEROOT "/var/tmp/maltrace/trace."
void
malloc_set_tracefn (s, fn)
char *s;
char *fn;
{
#ifdef MALLOC_TRACE
FILE *fp;
char defname[sizeof (TRACEROOT) + 64];
fp = _imalloc_fopen (s, fn, TRACEROOT, defname, sizeof (defname));
if (fp)
malloc_set_tracefp (fp);
#endif
}