2007-08-03 15:05:00 +00:00
|
|
|
#include "config.h"
|
2006-09-03 12:48:23 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2007-08-03 15:05:00 +00:00
|
|
|
#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
|
|
|
|
#include <malloc.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void minfo(void)
|
|
|
|
{
|
|
|
|
#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
|
|
|
|
struct mallinfo mi;
|
|
|
|
mi = mallinfo();
|
|
|
|
printf(" fordblks = %d\n", mi.fordblks);
|
|
|
|
malloc_stats();
|
|
|
|
printf("\n");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2006-09-03 12:48:23 +00:00
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
char *p;
|
|
|
|
|
2007-08-03 15:05:00 +00:00
|
|
|
minfo();
|
2006-09-03 12:48:23 +00:00
|
|
|
p = malloc(10);
|
|
|
|
free(p);
|
2007-08-03 15:05:00 +00:00
|
|
|
minfo();
|
2006-09-03 12:48:23 +00:00
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
2007-08-03 15:05:00 +00:00
|
|
|
|
|
|
|
/* vim:ts=2:sw=2:et:
|
|
|
|
*/
|