adapted sizes somewhat, made facility to print memory statistics

This commit is contained in:
ceriel
1987-08-11 14:42:15 +00:00
parent a7b7fa4162
commit 0300bbf5cb
4 changed files with 41 additions and 15 deletions

View File

@@ -19,6 +19,9 @@ static char rcsid[] = "$Header$";
#include "orig.h"
extern bool incore;
#ifndef NOSTATISTICS
int statistics;
#endif
#ifndef NDEBUG
int DEB = 0;
#endif
@@ -37,6 +40,9 @@ static change_names();
static bool tstbit();
static second_pass();
static pass2();
#ifndef NOSTATISTICS
static do_statistics();
#endif
main(argc, argv)
int argc;
@@ -44,6 +50,9 @@ main(argc, argv)
{
initializations(argc, argv);
first_pass(argv);
#ifndef NOSTATISTICS
do_statistics();
#endif
freeze_core();
evaluate();
beginoutput();
@@ -52,6 +61,22 @@ main(argc, argv)
stop();
}
#ifndef NOSTATISTICS
static
do_statistics()
{
register struct memory *m = mems;
while (m <= &mems[NMEMS-1]) {
fprintf(stderr, "mem %d: full %lx, free %lx\n",
m - mems,
(long) m->mem_full,
(long) m->mem_left);
m++;
}
}
#endif
char *progname; /* Name this program was invoked with. */
int passnumber; /* Pass we are in. */
struct outhead outhead; /* Header of final output file. */
@@ -193,6 +218,9 @@ first_pass(argv)
if (searchname(*argv, h) == (struct outname *)0)
entername(makename(*argv), h);
break;
case 'S':
statistics = 1;
break;
default:
warning("bad flag letter %c", *argp);
break;