
/*
 * (c) Copyright 1990, 1991, 1992 Conor P. Cahill (uunet!virtech!cpcahil).  
 * You may copy, distribute, and use this software as long as this
 * copyright statement is not removed.
 */
#include "sysdefs.h"
#include <stdio.h>
#if ANSI_HEADERS
#include <stdlib.h>
#endif
#include <sys/types.h>
#include "malloc.h"

VOIDTYPE	sub1();
VOIDTYPE	sub2();
VOIDTYPE	sub3();

/*ARGSUSED*/
int
main(argc,argv)
	int			  argc;
	char			**argv[];
{

	char			* s;

	malloc_enter("main");

	s = malloc(10);

	sub1();
	sub2();
	sub3();
	
	malloc_leave("main");
	
	malloc_dump(1);

	return(0);
}

VOIDTYPE
sub1()
{
	char 	* s;
	malloc_enter("sub1");

	s = malloc(0);	

	sub2();

	sub3();
	
	sub2();

	s = malloc(10);

	malloc_leave("sub1");
}

VOIDTYPE
sub2()
{
	char 	* s;
	malloc_enter("sub2");

	s = malloc(0);	

	sub3();
	
	s = malloc(10);

	malloc_leave("sub2");
}

VOIDTYPE
sub3()
{
	char 	* s;
	malloc_enter("sub3");

	s = malloc(1);	

	strcpy(s,"1");

	malloc_leave("sub3");
}

