Revision c0f12bb6f3ea8f1350371695b42990a5c2eb93f2 authored by Giuseppe Attardi on 02 March 1998, 23:00:00 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 55778ad
Raw File
testmsw2.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
test()
{
	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);

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

	if (argc == 2)
	      par = atoi(argv[1]);
	if (par)
	      printf("\n+++++ Using collector +++++\n");
	test();
	if (par) 
	      mswCollect();
	test();
	if (par)
	      mswCollect();
	mswShowInfo();
	mswCheckHeap(1);
}
back to top