commit bash-20180622 snapshot

This commit is contained in:
Chet Ramey
2018-06-25 15:33:19 -04:00
parent d58f7f88ed
commit c181950a89
15 changed files with 11851 additions and 11722 deletions
+8
View File
@@ -36,6 +36,8 @@
extern int malloc_free_blocks __P((int));
extern int malloc_mmap_threshold;
extern struct _malstats _mstats;
extern FILE *_imalloc_fopen __P((char *, char *, char *, char *, size_t));
@@ -103,6 +105,10 @@ _print_malloc_stats (s, fp)
for (i = totused = totfree = 0; i < NBUCKETS; i++)
{
v = malloc_bucket_stats (i);
/* Show where the mmap threshold is; sizes greater than this use mmap to
allocate and munmap to free (munmap shows up as lesscore). */
if (i == malloc_mmap_threshold+1)
fprintf (fp, "--------\n");
if (v.nmal > 0)
fprintf (fp, "%8lu\t%4d\t%6d\t%5d\t%8d\t%8d %5d %8d\n", (unsigned long)v.blocksize, v.nfree, v.nused, v.nmal, v.nmorecore, v.nlesscore, v.nsplit, v.ncoalesce);
totfree += v.nfree * v.blocksize;
@@ -115,6 +121,8 @@ _print_malloc_stats (s, fp)
_mstats.nmal, _mstats.nfre, _mstats.nrealloc, _mstats.nrcopy);
fprintf (fp, "Total sbrks: %d, total bytes via sbrk: %d\n",
_mstats.nsbrk, _mstats.tsbrk);
fprintf (fp, "Total mmaps: %d, total bytes via mmap: %d\n",
_mstats.nmmap, _mstats.tmmap);
fprintf (fp, "Total blocks split: %d, total block coalesces: %d\n",
_mstats.tbsplit, _mstats.tbcoalesce);
}