https://github.com/Unipisa/CMM
Revision cfa29670480cf0d5f09f5e3055e530dec3e6ff65 authored by Giuseppe Attardi on 24 November 1996, 18:13:45 UTC, committed by CMM Curation Team on 11 December 2019, 14:35:48 UTC
Contributors mentioned in Changelog :
 - Giuseppe Attardi @attardi
 - Tito Flagella @tflagella
 - Pietro Iglio
1 parent b2be05b
Raw File
Tip revision: cfa29670480cf0d5f09f5e3055e530dec3e6ff65 authored by Giuseppe Attardi on 24 November 1996, 18:13:45 UTC
1.7 -
Tip revision: cfa2967
testp3.c
#include <stdlib.h>
#include <stdio.h>
#include "msw.h"

#define VECT_SIZE	350

char *	v1[VECT_SIZE];
char *	v2[VECT_SIZE];

static par = 0;

void
test1()
{
	int i;

	for (i = 1; i < VECT_SIZE; i++) {
		v1[i] = (char *) mswAlloc(i);
		v1[i] = (char *) mswAllocOpaque(i * 80);
	}

	for (i = 1; i < VECT_SIZE; i++) {
		v1[i] = (char *) mswAllocOpaque(i * 80);
	}
}

extern void mswShowFreeChunks(void);

int 
main(int argc, char ** argv)
{

	if (argc == 2)
	      par = atoi(argv[1]);

	if (par)
	      printf("\n+++++ Using collector +++++\n");

	mswInit();

	test1();
	if (par) 
	      mswCollect();
	test1();
	if (par)
	      mswCollect();

	mswShowInfo();
	mswCheckHeap(1);

	return 0;
}
back to top