1 /* mstats.h - definitions for malloc statistics */
3 /* Copyright (C) 2001 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
31 * NMALLOC[i] is the difference between the number of mallocs and frees
32 * for a given block size. TMALLOC[i] is the total number of mallocs for
33 * a given block size. NMORECORE[i] is the total number of calls to
34 * morecore(i). NMAL and NFRE are counts of the number of calls to malloc()
35 * and free(), respectively. NREALLOC is the total number of calls to
36 * realloc(); NRCOPY is the number of times realloc() had to allocate new
37 * memory and copy to it. NRECURSE is a count of the number of recursive
38 * calls to malloc() for the same bucket size, which can be caused by calls
39 * to malloc() from a signal handler. NSBRK is the number of calls to sbrk()
40 * (whether by morecore() or for alignment); TSBRK is the total number of
41 * bytes requested from the kernel with sbrk(). BYTESUSED is the total
42 * number of bytes consumed by blocks currently in use; BYTESFREE is the
43 * total number of bytes currently on all of the free lists. TBSPLIT is
44 * the number of times a larger block was split to satisfy a smaller request.
45 * NSPLIT[i] is the number of times a block of size I was split.
46 * TBCOALESCE is the number of times two adjacent smaller blocks off the free
47 * list were combined to satisfy a larger request.
50 int nmalloc[NBUCKETS];
51 int tmalloc[NBUCKETS];
52 int nmorecore[NBUCKETS];
67 /* Return statistics describing allocation of blocks of size BLOCKSIZE.
68 NFREE is the number of free blocks for this allocation size. NUSED
69 is the number of blocks in use. NMAL is the number of requests for
70 blocks of size BLOCKSIZE. NMORECORE is the number of times we had
71 to call MORECORE to repopulate the free list for this bucket. NSPLIT
72 is the number of times a block of this size was split to satisfy a
83 extern struct bucket_stats malloc_bucket_stats ();
84 extern struct _malstats malloc_stats ();
85 extern void print_malloc_stats ();
86 extern void trace_malloc_stats ();
88 #endif /* MALLOC_STATS */
90 #endif /* _MSTATS_H */