Commit 99c028ab authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(main): Handle TRACED_ALLOCATIONS.

parent 891fd1b8
#include <config.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
......@@ -7,6 +9,10 @@
#include "s-string.h"
#include "../local-to-global.h"
#ifdef TRACED_ALLOCATIONS
# include "../trace-alloc.h"
#endif
const int MAXMAPS = 10;
const int LINSIZE = 1024;
......@@ -39,6 +45,26 @@ main(void)
int ok;
char *s;
#ifdef TRACED_ALLOCATIONS
/* We must do this before we allocate any memory... */
{
char buf[1024];
char *nl;
fputs("Where does the trace want to go today? [stderr]\n", stdout);
fflush(stdout);
if (fgets(buf, sizeof(buf), stdin) != buf)
{
fprintf(stderr, "unable to read trace location\n");
exit(1);
}
if ((nl = strchr(buf, '\n')) != NULL)
*nl = '\0';
trace_alloc_file(buf);
}
#endif
l2g_set_block_size(10);
printf("l2g> ");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment