From 5e0e9b99dc3fc0ecd49d929db0d57c784b66f481 Mon Sep 17 00:00:00 2001 From: svn2git Date: Fri, 1 Jul 1994 00:00:00 -0800 Subject: Release FreeBSD 1.1.5.1 This commit was manufactured to restore the state of the 1.1.5.1-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs. --- lib/libmalloc/stats.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/libmalloc/stats.c (limited to 'lib/libmalloc/stats.c') diff --git a/lib/libmalloc/stats.c b/lib/libmalloc/stats.c new file mode 100644 index 000000000000..05ebb48ad869 --- /dev/null +++ b/lib/libmalloc/stats.c @@ -0,0 +1,38 @@ +/* Author: Mark Moraes */ + +/*LINTLIBRARY*/ + +#include "defs.h" +#include "globals.h" + +RCSID("$Id: stats.c,v 1.1 1994/03/06 22:59:53 nate Exp $") + +/* + * Dumps the distribution of allocated sizes we've gathered so far + */ +void +mal_statsdump(fd) +FILE *fd; +{ +#ifdef PROFILESIZES + int i; + char buf[128]; + + for (i = 1; i < MAXPROFILESIZE; i++) { + if(_malloc_scount[i] > 0) { + (void) sprintf(buf, "%lu: %lu\n",(ulong)i*sizeof(Word), + (ulong) _malloc_scount[i]); + (void) fputs(buf, fd); + _malloc_scount[i] = 0; + } + } + if (_malloc_scount[0] > 0) { + (void) sprintf(buf, ">= %lu: %lu\n", + (ulong) MAXPROFILESIZE * sizeof(Word), + (ulong) _malloc_scount[0]); + (void) fputs(buf, fd); + _malloc_scount[0] = 0; + } + (void) fflush(fd); +#endif /* PROFILESIZES */ +} -- cgit v1.3