#include <stdio.h>
:1#include "V.h"
/*
* This is the second stage of jc's test of the free() call. The problem we're
* looking for is the possibility of residual data from one process turning up
* in another process's address space.  The freetest program should have  just
* been  run.   It will have left behind a lot of residual data, which we will
* attempt to get via malloc.  On a system without the residual data  problem,
* this program will produce no output.  Any output produced will be a hexdump
* of blocks that contain nonnull data. If freetest1 just exited, then we will
* typically find its data in the hexdump.
*/

#define WORDS 1000

main(ac,av)
	int   ac;
	char**av;
{	int   i=0;
	int   n=0;
	int  *p=0;
	int   s=WORDS*sizeof(int);
:1	char  tag[8];

:1	ac = Vinit(ac,av);

	while (p = (int*)malloc(s)) {
		++n;
		for (i=0; i<WORDS; i++) {
			if (p[i]) {
:1				sprintf(tag,"B%06d",n);
:1				H1(p,s,tag);
				break;
			}
		}
	}
	exit(0);
}
