File:  [Research Unix] / researchv10dc / vol2 / anim / malloc.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 3 months ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross

int	mallocinit = 0;
FILE	*mallocfp;

char *emalloc(n)
int n;
{	char *p;
	if (mallocinit == 0) {
		mallocinit = 1;
		mallocfp = fopen("/tmp/malloc.hist", "w");
	}
	p = malloc((unsigned) n);
	if (p == NULL) fatal("out of memory");
	fprintf(mallocfp, "m\t%d\t%d\n", (int) p, n);
	return p;
}

efree(p)
char *p;
{	fprintf(mallocfp, "f\t%d\n", (int) p);
	free(p);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.